-2

这是简单的 SQL 查询...我想selected field not all table fields通过 Using获得Entity frame work List function

"Select CustName, CustEmail, CustAddress, CustContactNo  from Customers"
4

1 回答 1

2

我假设您已经定义了上下文并映射了表。

var results = dbContext.Customers.Select(x => new { x.CustName, x.CustEmail, x.CustAddress, x.CustContactNo }).ToList();
于 2013-07-24T11:39:19.080 回答