Ven*_*nky -2 c# linq excel guid
我正在读取collection of strings (of GUID format)来自excel并希望将它们存储在数据库中作为collection of GUIDs. 我只是想知道是否有任何干净的方法可以转换List<string>为List<Guid>使用Linq. 我对循环遍历不感兴趣。
collection of strings (of GUID format)
excel
collection of GUIDs
List<string>
List<Guid>
Linq
Tim*_*ter 5
要么 LINQ:
List<Guid> guids = guidStrings.Select(Guid.Parse).ToList();
或者List.ConvertAll哪个更有效,因为它知道大小:
List.ConvertAll
List<Guid> guids = guidStrings.ConvertAll(Guid.Parse);
归档时间:
9 年,6 月 前
查看次数:
3898 次
最近记录: