I have a Entity
Collection Like this:
EntityCollection users;
I want to convert it to a Ilist
like this:
systemUsers = new List<CrmSdkTypeProxy.SystemUser>();
where CrmSdkTypeProxy.SystemUser
is a type of Entity
. However, my Entity
Collection is derived from a dll
of Microsoft.Xrm.Sdk
which does not implement IEnumerable
. I am using mscrm
2011 specific dlls
.
Any idea on how I create a list like this: .List<CrmSdkTypeProxy.SystemUser>
?
This worked for me.
Entities is a
DataCollection<Entity>
which you can convert into anIEnumerable
and then use theToList
function to create your List which matches theIList
interface that you require.Finally...iterated through the DataCollection and added individual values to the Ilist
from what I gather from http://msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.entitycollection_members.aspx and the top of my head:
and linq-less: