I have a solution which consists of Data Access Layer(DAL), Business Layer and Presentation layer. I create data-context in DAL as follows :
using(var context = new DBContext){ .... }
For one complete process say 'Purchase', I have to move between layers constantly. I want to revert back all the changes in case of any exception raised either in Business layer or in DAL during process using Transactions. But my problem is that when I move from DAL to business layer, the corresponding context gets disposed. So how do I manage Transactions in this case. Is there anything wrong with my design.
Please share links if you have any for the same, it will be helpful.
Thanks