I am trying to use Joseph Albahari's PredicateBuilder with my applications Respository which is giving me the following error:
The best overloaded method match for 'MySite.DAL.Respositories.IMyObjRepository.SearchFor(System.Linq.Expressions.Expression<System.Func<MySite.DAL.MyObj,bool>>
)' has some invalid arguments
Signiture for MySite.DAL.Respositories.IMyObjRepository.SearchFor:
public IQueryable<MyObj> SearchFor(Expression<Func<MyObj, Boolean>> predicate)
Code calling SearchFor:
var predicate = PredicateBuilder.True<MySite.DAL.MyObj>();
predicate = predicate.And(a => a.county.name == CountyName);
return _myObjRespository.SearchFor(predicate);
I am aware that I do not need PredicateBuilder for this query - I have simplified it for the purposes of this question. The simplified version still gives the same error.
Any help/ideas/advice appreciated.
Thank you.