【发布时间】:2011-05-14 11:14:46
【问题描述】:
我有以下代码:
List<string> aa = (from char c in source
select new { Data = c.ToString() }).ToList();
但是
List<string> aa = (from char c1 in source
from char c2 in source
select new { Data = string.Concat(c1, ".", c2)).ToList<string>();
编译时出错
无法将类型
'System.Collections.Generic.List<AnonymousType#1>'隐式转换为'System.Collections.Generic.List<string>'
需要帮助。
【问题讨论】:
-
最后的任务是什么,来源是什么?
-
至于您上次编辑两次提到同一来源,请参阅我的回答 #2 - 它可以帮助您。
标签: c# .net linq compiler-errors