【发布时间】:2015-03-25 21:35:55
【问题描述】:
List<string> MealNames = FoodPlanerList.Select( p => p.Meals.ToList().Select(t => t.name).ToList<String>());
错误 CS0266:无法隐式转换类型
System.Collections.Generic.IEnumerable<System.Collections.Generic.List<string>>' toSystem.Collections.Generic.List'。存在显式转换(您是否缺少演员表?) (CS0266) (FoodPlanViewer)
我尝试返回一个字符串列表。我有List<Meals>。 Meals 包含字符串名称。我无法返回带有List<Meals> 的所有名称的List<string>。
【问题讨论】:
标签: c# list generics ienumerable