如何将实体集合转换为列表? [英] How to convert Entity Collection to List ?
本文介绍了如何将实体集合转换为列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Dynamics CRM 2011 RetriveMultiple方法返回EntityCollection。我需要将返回的实体集转换为List吗?
The Dynamics CRM 2011 RetriveMultiple method returns an EntityCollection. I need to convert the returned entity collection to a List ?
推荐答案
您是否尝试过:
List< ; myEntity所> entityList = new List< myentity>(myEntityCollection);
顺便提一下,如果你导入System.Linq命名空间以便将.ToList()扩展方法带入范围,那么就没有理由:
列表< myentity> entityList = myEntityCollection.ToList();
不能用作EntityCollection< t>实现IEnumerable< t> ;.
参考:
http://stackoverflow.com/questions/7640836/how-to-convert-entitycollectiont-to-listt [ ^ ]
Did you try:
List<myentity> entityList = new List<myentity>(myEntityCollection);
And by the way if you import the System.Linq namespace in order to bring the .ToList() extension method into scope, there's no reason why:
List<myentity> entityList = myEntityCollection.ToList();
wouldn't work as EntityCollection<t> implements IEnumerable<t>.
Refer :
http://stackoverflow.com/questions/7640836/how-to-convert-entitycollectiont-to-listt[^]
请转到通过这个,这将帮助你
将实体收藏转换为列表
Please go through this, this will help you
convert an Entity Collection to a List
这篇关于如何将实体集合转换为列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文