var db = new DBEntities();
var query = from m in db.tables
select new{
m.id,m.name
}.ToList().Select(m=>new tables{m.id,m.name}).ToList();
将赋值操作分为两步
参考:https://www.cnblogs.com/dudu/archive/2011/03/31/entity_framework_select_new.html
var db = new DBEntities();
var query = from m in db.tables
select new{
m.id,m.name
}.ToList().Select(m=>new tables{m.id,m.name}).ToList();
将赋值操作分为两步
参考:https://www.cnblogs.com/dudu/archive/2011/03/31/entity_framework_select_new.html