帮助我将LINQ对象转换为数组或列表 [英] Help me converting the LINQ object to array or list
本文介绍了帮助我将LINQ对象转换为数组或列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
var mailingList = (from mailTo in filteredData
select new {AssignedTo = mailTo.AssignedTo}).Distinct();
想要mailList作为和List。
Wanted the mailingList as and List.
推荐答案
你好请试试这个代码
Hi please try this code
var mailingList = (from mailTo in filteredData
select new {AssignedTo = mailTo.AssignedTo}).Distinct().ToArray();
有很多例子,你可以参考以下链接。
http://stackoverflow.com/questions/1378801/convert-linq-query-to-string-array-c-sharp [ ^ ]
Linq转换的总体最佳示例。
http://www.dotnetperls.com/linq [ ^ ]
There are many examples, you can refer following links.
http://stackoverflow.com/questions/1378801/convert-linq-query-to-string-array-c-sharp[^]
Overall best example for Linq Conversion.
http://www.dotnetperls.com/linq[^]
这篇关于帮助我将LINQ对象转换为数组或列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文