/// <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; }
/// <summary> /// Constructor which takes a db context and wires up the stores with default instances using the context /// </summary> /// <param name="context"></param> public ApplicationUserStore(HellolingoEntities context) { if (context == null) { throw new ArgumentNullException("context"); } Context = context; AutoSaveChanges = true; _userStore = new EntityStore <AspNetUser>(context); _roleStore = new EntityStore <AspNetRole>(context); _logins = Context.Set <AspNetUserLogin>( ); _userClaims = Context.Set <AspNetUserClaim>( ); //_userRoles = Context.Set<AspNetRole>( ); }