/// <summary> /// Maps a <see cref="System.Transactions.IsolationLevel"/> to <see cref="IsolationLevel"/> /// </summary> /// <param name="isolationLevel">The isolation level to map.</param> /// <returns>A corresponding <see cref="IsolationLevel"/></returns> private static IsolationLevel MapToSystemDataIsolationLevel(System.Transactions.IsolationLevel isolationLevel) { switch (isolationLevel) { case System.Transactions.IsolationLevel.Chaos: return(IsolationLevel.Chaos); case System.Transactions.IsolationLevel.ReadCommitted: return(IsolationLevel.ReadCommitted); case System.Transactions.IsolationLevel.ReadUncommitted: return(IsolationLevel.ReadUncommitted); case System.Transactions.IsolationLevel.RepeatableRead: return(IsolationLevel.RepeatableRead); case System.Transactions.IsolationLevel.Serializable: return(IsolationLevel.Serializable); case System.Transactions.IsolationLevel.Snapshot: return(IsolationLevel.Snapshot); case System.Transactions.IsolationLevel.Unspecified: return(IsolationLevel.Unspecified); default: return(IsolationLevel.ReadCommitted); //default; } }
IsolationLevel GetSqlIsolationLevel(System.Transactions.IsolationLevel isolationLevel) { switch (isolationLevel) { case System.Transactions.IsolationLevel.Serializable: return(IsolationLevel.Serializable); case System.Transactions.IsolationLevel.RepeatableRead: return(IsolationLevel.RepeatableRead); case System.Transactions.IsolationLevel.ReadCommitted: return(IsolationLevel.ReadCommitted); case System.Transactions.IsolationLevel.ReadUncommitted: return(IsolationLevel.ReadUncommitted); case System.Transactions.IsolationLevel.Snapshot: return(IsolationLevel.Snapshot); case System.Transactions.IsolationLevel.Chaos: return(IsolationLevel.Chaos); case System.Transactions.IsolationLevel.Unspecified: return(IsolationLevel.Unspecified); } return(IsolationLevel.ReadCommitted); }
internal static IsolationLevel AsDataIsolationLevel(this System.Transactions.IsolationLevel level) { switch (level) { case System.Transactions.IsolationLevel.Chaos: return(IsolationLevel.Chaos); case System.Transactions.IsolationLevel.ReadCommitted: return(IsolationLevel.ReadCommitted); case System.Transactions.IsolationLevel.ReadUncommitted: return(IsolationLevel.ReadUncommitted); case System.Transactions.IsolationLevel.RepeatableRead: return(IsolationLevel.RepeatableRead); case System.Transactions.IsolationLevel.Serializable: return(IsolationLevel.Serializable); default: return(IsolationLevel.Unspecified); } }