开发者

Expression for children entitySet parent properties

开发者 https://www.devze.com 2022-12-21 17:44 出处:网络
I need to build an expression that will work on a parent entity properties so will do the following: IQueryable<Children> allChildren = from e in context.Children select e;

I need to build an expression that will work on a parent entity properties so will do the following:

IQueryable<Children> allChildren = from e in context.Children select e;

IQueryable<Children> filter = allChildren.Where(x => x.Parent.Name == "Value"); 

I created an expression of typ开发者_C百科e Expression.Lambda<Func<Parent, bool>> for that but I cannot use it on Children 'Where', no suitable overload. How to accomplish this? Children are entity set of a parent.


I figured that nested expression is what I need here and it's working fine

0

精彩评论

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

关注公众号