Hello,
I don't have a good understanding with how the Adapter scenario works when saving entities. I have an OrderEntity that has several linked entities: Order.Buyer, Order.Seller, Order.Products etc. If I use the following code:
UnitOfWork2 uow = new UnitOfWork2();
uow.AddForSave(order.BillingInformation, false);
uow.AddForSave(order.ShippingInformation, false);
uow.AddForSave(order.Buyer, false);
uow.AddForSave(order, false);
DataAccessAdapter adapter = new DataAccessAdapter();
uow.Commit(adapter, true);
When I do this, even the entities that I have not explicitly added to the UnitOfWork are saved. For example, I have an order.Seller entity that gets updated. How can I prevent the Seller entity from being updated? After making a call to ConstructSaveProcessQueues, I can see the SellerEntity in the _entitiesToUpdate field. I'm not sure why it is there.
By the way, I'm only using the UnitOfWork2 class because I want to be able to specify which entities to save and which to ignore. If there is a better way to accomplish this, please let me know.
Thanks,
Jason