/// <summary> /// Constructor which takes a db context and wires up the stores with default instances using the context /// </summary> /// <param name="context"></param> public GroupStore(DbContext context) { if (context == null) { throw new ArgumentNullException("context"); } this.Context = context; this._groupStore = new EntityStore <TGroup>(context); }
public RoleStore(DbContext context) { if (context == null) { throw new ArgumentNullException("context"); } this.Context = context; this._roleStore = new EntityStore <TRole>(context); }
/// <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 (this.DisposeContext && disposing && this.Context != null) { this.Context.Dispose(); } this._disposed = true; this.Context = null; this._groupStore = null; }
public UserStore(DbContext context) { if (context == null) { throw new ArgumentNullException("context"); } this.Context = context; this.AutoSaveChanges = true; this._userStore = new EntityStore <TUser>(context); this._roleStore = new EntityStore <TRole>(context); this._groupStore = new EntityStore <TGroup>(context); this._logins = this.Context.Set <TUserLogin>(); this._userClaims = this.Context.Set <TUserClaim>(); this._groupRole = this.Context.Set <TGroupRole>(); }