/// <summary> /// If disposing, calls dispose on the Context. Always nulls out the Context /// </summary> /// <param name="disposing"></param> protected virtual void Dispose(bool disposing) { if (DisposeContext && disposing && Context != null) { Context.Dispose(); } _disposed = true; Context = null; _userStore = null; }
public CustomUserStore(DbContext context) { Context = context; AutoSaveChanges = true; _userStore = new EntityStore <TUser>(context); _roleStore = new EntityStore <TRole>(context); _logins = Context.Set <TUserLogin>(); _userClaims = Context.Set <TUserClaim>(); _userRoles = Context.Set <TUserRole>(); }