New*_*eak 6 linq linqpad c#-4.0 dbcontext
\n \n\n\n\n\n
我正在 LINQPad 4 中使用 C# 表达式作为语言运行此查询
\n\nfrom t in typeof(UserQuery).GetProperties()\nwhere t.Name == "tablename"\nfrom c in t.GetValue(this,null).GetType().GetGenericArguments()[0].GetFields()\nselect c.Name\nRun Code Online (Sandbox Code Playgroud)\n\n但是当我在 C# Web 应用程序中使用此查询时,它会给出错误,没有 UserQuery 的引用
\n\nvar result = from t in typeof(UserQuery).GetProperties()\n where t.Name == "tablename"\n from c in t.GetValue(this,null).GetType().GetGenericArguments()[0].GetFields()\n select c.Name\nRun Code Online (Sandbox Code Playgroud)\n\n而 vs 2012 intellisense 没有选择它的任何参考。请告诉我需要添加哪个库引用来执行上述查询,或者需要创建哪个类对象来引用?
\n\n目前我使用 EF 5.0 和 DbContext 对象,该对象是通过数据库优先方法创建 EF 数据模型时生成的
\n\n我更喜欢与 DbContext 相关的答案
\n| 归档时间: |
|
| 查看次数: |
2820 次 |
| 最近记录: |