Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RoleStoreMultiHost{TKey, TKey, TRole}" /> class.
        /// </summary>
        /// <param name="context">The <c>DbContext</c>.</param>
        public HyperRoleStore(HyperDbContext <THost, THostDomain, TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim, TRoleGroup, TRoleGroupRole, TRoleGroupUser, TAudit, TAuditItem, TAuditProperty> context)
            : base(context)
        {
            Helpers.ThrowIfNull(context != null, "context");

            this.HyperContext = context;
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HyperHostStore{THost, TKey}"/> class.
        /// </summary>
        /// <param name="context">The context.</param>
        public HyperHostStore(HyperDbContext <THost, THostDomain, TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim, TRoleGroup, TRoleGroupRole, TRoleGroupUser, TAudit, TAuditItem, TAuditProperty> context)
        {
            Helpers.ThrowIfNull(context != null, "context");

            this.HyperContext    = context;
            this.AutoSaveChanges = false;

            this.hosts       = HyperContext.Set <THost>();
            this.hostDomains = HyperContext.Set <THostDomain>();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="HyperHostStore{TRoleGroup, TKey}"/> class.
        /// </summary>
        /// <param name="context">The context.</param>
        public HyperRoleGroupStore(HyperDbContext <THost, THostDomain, TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim, TRoleGroup, TRoleGroupRole, TRoleGroupUser, TAudit, TAuditItem, TAuditProperty> context)
        {
            Helpers.ThrowIfNull(context != null, "context");

            this.HyperContext      = context;
            this.AutoSaveChanges   = false;
            this.RoleGroupsEnabled = context.RoleGroupsEnabled;

            this.groups     = HyperContext.Set <TRoleGroup>();
            this.groupRoles = HyperContext.Set <TRoleGroupRole>();
            this.groupUsers = HyperContext.Set <TRoleGroupUser>();
            this.roles      = HyperContext.Set <TRole>();
            this.users      = HyperContext.Set <TUser>();
            this.userRoles  = HyperContext.Set <TUserRole>();
        }