HI,
Looking at LLBLGenProDomainService2 and the InsertEntity (UpdateEntity is the same), in the AddForSave the recurse parameter is set to true :
// SD.LLBLGen.Pro.RiaSupportClasses.LLBLGenProDomainService2
protected override void InsertEntity(IEntityCore toSave)
{
this.UnitOfWorkToUse.AddForSave((IEntity2)toSave, null, !EntityCore<IEntityFields2>.MarkSavedEntitiesAsFetched, true);
}
I wonder why this is? In general its not a problem but there is a slight temporal oddity. If you have in the changeset a master and a detail entity, where there is an update to the master entity and an insert for a new detail entity, the InsertEntity happens first. After the call to InsertEntity for the detail entity, but before the call to UpdateEntity for the master entity, the UnitOfWork contains both entities, due to the recurse, and both have IsNew == true. This is normally not an issue as the UpdateEntity will reset the master entity IsNew = false before the UnitOfWork is persisted, but if I wanted to know if there was a good reason for setting it to true. In my scenario, in the UpdateEntity method I have code which will Save (but not commit obviously) the UnitOfWork and hence it attempts to insert a new master entity. I know its all dead code, RIA/Silverlight, but if you can remember the reason it would be good to know so I can decide whether its ok to override the method and pass false.
Thanks,