Walaa.. I have worked with Mohammad on this problem and this is what happened.
The UOW was not even saving the entity and this error took us a whole day to debug with no luck. Eventually what Mohammad did was as follows:
He closed VS, deleted OBJ/BIN folders from the WEB and BL projects. The after re-opening the VS solution and rebuilding, MAGICALLY the UOW is saving the entities successfully.
What I would like to ask you is the following:
1- Each time we generate new DAL dlls, we copy them to the LIB folder referenced by the projects. All this is done while the WEB/BL solution is open. We do a solution clean from inside VS and rebuild.
Would you recommend a better approach?
2- When using a UOW to save entity with an identity property as the following senario:
uow.AddForSave(a, true) //a has an identity property
//....
uow.AddForSave(b) //b has a property that requires the identity value from entity a
uow.Commit(adapter,true)
will I be able to know the new identity value of entity a after adding it to uow or only after I commit uow?