我正在尝试从我创建的列表中获取特定的 x 项。
List<Item> il = (List<Item>)(from i in AllItems
where i.Iid == item.Iid
select i).Take(Int32.Parse(item.amount));
我收到以下错误:
“无法将 'd__3a`1[AssetManagement.Entities.Item]' 类型的对象转换为类型 'System.Collections.Generic.List`1[AssetManagement.Entities.Item]'。”
如何修复它,为什么会发生这种情况?