.net - How to use predicate search using Mongodb C# Driver -
how 1 use following method on awesome mongodb c# driver!????
public ilist<tentity>searchfor(expression<func<tentity, bool>> predicate) { return collection .asqueryable<tentity>() .where(predicate.compile()) .tolist(); }
examples ideal!
simply remove compile
because creates delegate
driver can't translate mongo query:
public ilist<tentity>searchfor(expression<func<tentity, bool>> predicate) { return collection .asqueryable<tentity>() .where(predicate) .tolist(); }
it means predicate expression must translatable mongodb
driver.
Comments
Post a Comment