开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜