I've always used the SelfServicing templates and recently decided to give Adapter a try, since we're using more and more WCF/WebServices.
One of the simple things I used to do in SelfServicing is add new entities to a collection by using the entity.relatedCollection.Add method. In adapter this gives me a 'Collection is read-only' error. I was wondering why this behaviour isn't possible using the adapter classes?
Example:
var collection = new CollectionEntity(1);
var prefetch = new PrefetchPath2(EntityType.CollectionEntity);
prefetch.Add(CollectionEntity.PrefetchPathAssets);
adapter.FetchEntity(collection, prefetch);
collection.Assets.AddNew();
adapter.SaveEntity(collection);
Should I manually set the parent ID on a new Entity or create a link-table entity to add an entity to a related collection?
I'm using 2.6 on .NET 3.5.