我试图返回列表清单。任何建议都是非常可观的。提前致谢。返回使用实体框架
它抛出这个错误:
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