Jak wycofać transakcję w Entity Framework

string[] usersToAdd = new string[] { "asd", "asdert", "gasdff6" };
using (Entities context = new Entities())
{
    foreach (string user in usersToAdd)
    {
        context.AddToUsers(new User { Name = user });
    }
    try
    {
        context.SaveChanges(); //Exception thrown: user 'gasdff6' already exist.
    }
    catch (Exception e)
    {
        //Roll back all changes including the two previous users.
    }

A może odbywa się to automatycznie, co oznacza, że ​​jeśli wystąpi błąd, zatwierdzenie zmian zostanie anulowane dla wszystkich zmian. to jest?

questionAnswers(2)

yourAnswerToTheQuestion