Announcements
No record found.
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
which is your exact requirement?
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.
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);
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
JS-09031509-0 3
AS-17030037-0 2
Mark Eckert 2