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;
}
}