Most of the cases, I am handling the CRUD operations through domain methods. There is business logic within the stored procedures (just a preference)
As soon as I call the domain method, the context starts a transaction and I am forced to call SaveChanges. But during updates, I get optimistic verification exception
My sequence of call is
1) Get the domain object from data context, make sure it is valid one. Update the values.
2) Call the domain method by passing the required values
3) Call save changes method.
Insert and delete works fine. But update gives me optimistic verification since the record is updated by the stored procedure.
Please give me proper way of using stored procedures for CRUD operations. Basically, I want to use ORM for get and manage the CRUD separately using the domain methods. I also want the changes made in SP to be reflected in next get call in the ORM.
What is the proper way to handle this?
Sambath.