以下是我的linq查詢。LINQ to Entities只支持無參數的構造函數和初始化器
var values = (from test in entities.Table1
select new Entity
{
Id = test.id,
Value = test.name
});
return values.ToList();
當蔭試圖運行它,我收到以下錯誤: Only parameterless constructors and initializers are supported in LINQ to Entities
。
「實體」映射到表? – Eranga
[只有無參數的構造函數和初始化程序在LINQ to Entities中受支持]的可能的重複(http://stackoverflow.com/questions/4217956/only-parameterless-constructors-and-initializers-are-supported-in-linq-to- entiti) –