Catel.Data.DbContextExtensions.SetTransactionLevel C# (CSharp) Метод

SetTransactionLevel() публичный статический Метод

Sets the transaction level of the specified DbContext.
The is null.
public static SetTransactionLevel ( this dbContext, IsolationLevel isolationLevel ) : void
dbContext this The db context.
isolationLevel IsolationLevel The isolation level to set.
Результат void
        public static void SetTransactionLevel(this DbContext dbContext, IsolationLevel isolationLevel)
        {
            Argument.IsNotNull("dbContext", dbContext);

            Log.Info("Setting transaction isolation level to '{0}' for DbContext '{1}'", isolationLevel, ObjectToStringHelper.ToFullTypeString(dbContext));

            var sqlCommand = IsolationHelper.TranslateTransactionLevelToSql(isolationLevel);
            var objectContext = dbContext.GetObjectContext();
            objectContext.ExecuteStoreCommand(sqlCommand);
        }
    }
DbContextExtensions