Taijutsu.Data.Internal.IsolationLevelExtensions.IsCompatible C# (CSharp) Method

IsCompatible() public static method

public static IsCompatible ( this self, IsolationLevel comparing ) : bool
self this
comparing IsolationLevel
return bool
        public static bool IsCompatible(this IsolationLevel self, IsolationLevel comparing)
        {
            if (self == IsolationLevel.Snapshot)
            {
                return comparing == IsolationLevel.Unspecified || comparing == IsolationLevel.Chaos || comparing == IsolationLevel.ReadUncommitted
                       || comparing == IsolationLevel.ReadCommitted || comparing == IsolationLevel.Snapshot;
            }

            if (comparing == IsolationLevel.Snapshot)
            {
                return self == IsolationLevel.Snapshot || self == IsolationLevel.RepeatableRead || comparing == IsolationLevel.Serializable;
            }

            return self >= comparing;
        }
    }
IsolationLevelExtensions