/// <summary> /// Creates a New <code>DbReposetoryIdentityInsertScope</code> or obtains the current active Instance /// </summary> /// <returns></returns> public static DbReposetoryIdentityInsertScope CreateOrObtain(bool rewriteDefaultValues = false) { if (Current.Value != null) { return(Current.Value); } var newScope = new DbReposetoryIdentityInsertScope(rewriteDefaultValues); try { newScope.EnsureTransaction(); return(newScope); } catch { newScope.Dispose(); throw; } }
internal override void SetStore(IdentityInsertScope item) { Current = (DbReposetoryIdentityInsertScope)item; }