我需要从表格中选择所有字段,我尝试使用以下代码进行操作,然后我得到错误通知类名称此时无效
from item in context.CreateQuery<permitdocumentfields>()
where item.Id == new Guid(Request["view"])
select new
{ permitdocumentfields }
如何使这些内容像FROM TABLE SELECT *
一样工作?
答案 0 :(得分:10)
from item in context.CreateQuery<permitdocumentfields>()
where item.Id == new Guid(Request["view"])
select item
查看帖子了解更多详情:SQL to LINQ ( Visual Representation )
简单选择
选择过滤器并选择新
注意:当您只想构建新对象时,需要select new
。