添加基于表达式的版本以包含运算符 [英] Add expression based version to include operator
本文介绍了添加基于表达式的版本以包含运算符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
目前新的EF 4.0有context.LoadProperty方法,该方法使用表达式语法来获取属性名称。
我认为你应该为ObjectQuery Include方法添加相同的重载。
例子:
products.Include(p => p.Tags)
Currently new EF 4.0 has context.LoadProperty method which uses expression syntax to get property name.
I think you should add the same overload to ObjectQuery Include method.
Example:
products.Include(p => p.Tags)
推荐答案
绝对,我相信那里已经编写了扩展方法来执行此操作。从我们的目标中删除所有EF LINQ查询中的字符串。
Absolutely, and I believe that there have been extension methods written that do do this. Removing strings from all EF LINQ queries is a goal for us.
这篇关于添加基于表达式的版本以包含运算符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文