How to execute function? which type of parameter should?
how to use following function
public IList<T> GetAll(Expression<Func<T, bool>> whereCondition)
{
return this.ObjectSet.Where(whereCondition).ToList<T>();
}
like
_tabmasterS开发者_开发百科ervice.GetSingle( ... what should here.. );
_tabmasterService.GetAll(x => x.Name == "fred");
In your example a call to GetAll would look something like this
_tabmasterService.GetAll(x => x.SomeProperty == someValue);
This is a bit of syntactic sugar around delegates. You can read a bit more here.
精彩评论