This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
When I take an Item from one EntityCollection to another everything is fine. Except when I remove the Entity from the UOW the items in the new collection remove from not only the old entities EntityCollection but also the new Example: this.MGrades.AddRange(old.MGrades);
I have tried a foreach Add and AddRange both yeild the same results. |
|
|
Hi Tommy, Just looking to repro this - can you post the association definitions from both sides? (both fields and property accessors).
Cheers :) |
|
|
It is all generated code. Perhaps because on my MSizeAlias I have two reverseassociation with the same collection name? ---GENERATED MSIZE [ReverseAssociation("MSize")] public EntityCollection<MSizeAlias> MSizeAliases --GENERATED MSIZEALIAS [ReverseAssociation("MSizeAliases")] public MSize MSize
|
|
|
Here is the code used to transfer the data from one collection to the other public void Merge(IUnitOfWork work, IEnumerable<MSize> sizes) public static void Merge<T>(this EntityCollection<T> items, IEnumerable<T> newItems) |
|
|
I changed my merge function to remove the entity and add it and it works now. For some reason I thought it did this automatically.
public static void Merge<T>(this EntityCollection<T> items, EntityCollection<T> newItems) |
|