Walaa wrote:
PersonEntity removeParent = new PersonEntity(parent.Guid);
removeParent.IsActive = false; <-- just this line alone will trigger a new record to be created in the db
removeParent.Save();
There must be something in your code. It seemsthat either there is a database trigger, or an OnSave() event is handled that inserts the new record.
Please check removeParent.IsNew to see if a record has been fetched using LazyLoading after calling the CTor.
Irrelevant hint: when an item is Found, break from the inner loop.
Thanks for the tips.. but false alarm
I discovered another process in the code base that was generating new entities from reading the textfile - and it must be caching it, or something, and adding a new entity from a "blank" row.. which exposed the bug in the this code that wasn't checking for valid data before creating the entity.
With that cleared up, the LLBL gen entites SaveMulti(true) works slick to work on complex datasets.
Thanks,
Jay