Rollback from linq to sql?
I have it
Public void CreateUser(params here)
{
CreateMembership(params here);
Users newUser = new Users();
newUser.UserId = 123456
Context.Users.insertOnSubmit();
Context.Submit();
}
public void CreateMembership(...)
{
Membership membership = new Membership();
membership.Something = "something";
Context.Membership.insertOnSumbit();
Context.Submit();
}
So what happens if the Users table is submitted with an error, how can I return it to remove the membership? Or can I customize my thing differently as soon as I remove the Context.Submit () line from the Membership method?
Then only one Submit is called? Or do I need to do something else?
+2
source to share
3 answers