Hey I have two entity-reference-collections and I need to combine/merge/unite them into one, How can I do that?
*This post is locked for comments
Hi ,
Please provide your specific requirement with scenario which will help to get clear answer from people here.
I am assuming you want to merge entity collection in that case there should be some condition before merge, so you need to loop through one entity collection using .NET LINQ merge another entity reference based on conditions.
If you want to simply add another same list of entity collection you can simply use -
entCollection1.AddRange(listentCollection12);
Hi Sahara,
Like Guido asked, what exactly is your requirement.
Adding to collection can be easily done using AddRange of a collection in .net code:
List<EntityReference> list1 = new List<EntityReference>();
List<EntityReference> list2 = new List<EntityReference>();
Option 1:
list2.AddRange(list1);
Option 2:
EntityReferenceCollection entityReferenceCollection = new EntityReferenceCollection(list1);
entityReferenceCollection.AddRange(list2);
You can play around with this as there are a lot of other options...
Hope this helps.
which is your exact requirement?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156