我試圖返回列表清單。任何建議都是非常可觀的。提前致謝。返回使用實體框架
它拋出這個錯誤:
Cannot implicitly convert type
System.Collections.Generic.List<HTentityFramework.tblFlower>
to
System.Collections.Generic.List<HTentityFramework.testDomain>
代碼是:
public class GetFlowers
{
public IList<testDomain> getFlowerList()
{
TestContainer ctx = new TestContainer();
return ctx.tblFlowers.ToList();
}
}
public class testDomain
{
public string Name { get; set; }
public int quantity { get; set; }
}
你有問題嗎? – SLaks 2012-03-17 01:35:27
它將錯誤引發爲錯誤\t無法將類型'System.Collections.Generic.List'隱式轉換爲'System.Collections.Generic.List ' –
Kurkula
2012-03-17 02:35:47