我有使用Select new
的挑战通常我们会这样做
var record = from s in db.Settings
select new
{
myID = s.ID,
customName = s.PkGuid
};
但如果我愿意,我们不能选择新的:
CacheHelper.Settings().Select(a => ???????)
任何人?!
谢谢:)
答案 0 :(得分:1)
你让我不确定30毫秒!
var record = CacheHelper.Settings().Select(a => new {
myID = a.ID,
customName = a.PkGuid
});