Hi,
we have a following situation:
we need to clear all values in the db using some filter to ensure that we don't have any junks in the db. After that we need to add some new entries on the place of existing.
Example:
Lets say we Have a table A with column id_foreign, created_by and some other columns not important for this example.
First we're creating an UnitOfWork object.
Next we're using AddDeleteEntitiesDirectly method of UOW with filter on id_foreign and cread_by columns.
After that we're creating new AEntity objects and adds them to UOW using AddCollectionForSave method. The thing that probably creates an issue is that newly created entities match delete criteria on UOW. But only these two fields are same - rest of them are totally different then that one which were removed from DB.
At the finish we're commiting changes on UOW object. Unfortunateley on the result UOW does nothing because probably it thinks that this two actions neutralize each other. When we've temporally commented delete action newly created entites has been successfully created.
How can we fullfill a mentioned requirements (delete and create new Entities in the same UOW object)?
Best Regards,
MiloszeS