【发布时间】:2012-06-15 18:16:53
【问题描述】:
我正在使用 mvc4.0,enityframework 4.2.1,c#,在生成 .EDMX 文件后,我尝试通过以下代码将上下文对象转换为 IEnumerable
IEnumerable<TransactionsModel> pro = (IEnumerable<TransactionsModel>) x.ToList();
但我收到以下错误
Unable to cast object of type 'System.Data.Objects.ObjectSet`1[MCLInventory.Models.Projects]'
to type 'System.Collections.Generic.IList`1[System.String]'.
谢谢 Bhanu Prakash Inturi
【问题讨论】:
标签: c#-4.0 entity-framework-4.1