In my constructor i’m inititialising some (ICollection) collections, but during deserialization the collection is re-created using the base constructor of the type.
public class Country : LookupItem {
public Country() {
Provinces = new EmbeddedList<Province>(this);
Cultures = new EmbeddedItems<System.Globalization.CultureInfo>(this);
}
public EmbeddedList<Province> Provinces { get; private set; }
I’m storing the reference to the “owning” object in the collection, but due to the CreateInstance in the CollectionExtensions.CreateAndPopulate the collection is re-created. Shouldn’t this be skipped when the collection is not null and call collection.clear() before adding the items?