This question is locked. New answers and comments are not allowed.
Hello,
With the new Domain Model in Q2 version, how do you control transaction?
I created a new test project with an existing database and the new Domain Model does not have ObjectScope provider, so how do you start, commit, rollback changes in the transaction? Where is the dispose function for the data model context?
For example, how do you rollback after an error in an edit action, such as:
Thanks.
With the new Domain Model in Q2 version, how do you control transaction?
I created a new test project with an existing database and the new Domain Model does not have ObjectScope provider, so how do you start, commit, rollback changes in the transaction? Where is the dispose function for the data model context?
For example, how do you rollback after an error in an edit action, such as:
var dataModel = DbContextFactory.GetContextPerRequest(
this
.Context);
var inID = Convert.ToInt32(TestID.Text);
var tests = from t
in
dataModel.Tests where t.TestID == inID select t;
using
(dataModel)
{
var entity = tests.First();
entity.Value =
"Edited "
+ DateTime.Now;
dataModel.SaveChanges();
}
Thanks.