当前位置: 首页>>代码示例>>C#>>正文


C# ApplicationRoleManager类代码示例

本文整理汇总了C#中ApplicationRoleManager的典型用法代码示例。如果您正苦于以下问题:C# ApplicationRoleManager类的具体用法?C# ApplicationRoleManager怎么用?C# ApplicationRoleManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ApplicationRoleManager类属于命名空间,在下文中一共展示了ApplicationRoleManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AccountController

 public AccountController(ApplicationUserManager userManager, ApplicationSignInManager signInManager, IAuthenticationManager authenticationManager, ApplicationRoleManager roleManager)
 {
     this.userManager = userManager;
     this.signInManager = signInManager;
     this.authenticationManager = authenticationManager;
     this.roleManager = roleManager;
 }
开发者ID:mmoore99,项目名称:IoCIdentitySample,代码行数:7,代码来源:AccountController.cs

示例2: IdentityUnitOfWork

 public IdentityUnitOfWork(string connectionString)
 {
     _db = new ApplicationContext(connectionString);
     _userManager = new ApplicationUserManager(new UserStore<ApplicationUser>(_db));
     _roleManager = new ApplicationRoleManager(new RoleStore<ApplicationRole>(_db));
     _clientManager = new ClientManager(_db);
 }
开发者ID:sweexxik,项目名称:Uav-Site,代码行数:7,代码来源:IdentityUnitOfWork.cs

示例3: AccountController

 public AccountController(ApplicationUserManager userManager, ApplicationRoleManager roleManager,
     ISecureDataFormat<AuthenticationTicket> accessTokenFormat)
 {
     RoleManager = roleManager;
     UserManager = userManager;
     AccessTokenFormat = accessTokenFormat;
 }
开发者ID:adaluo,项目名称:SimonTan,代码行数:7,代码来源:AccountController.cs

示例4: IdentityModelHelper

 public IdentityModelHelper(ApplicationUserManager userManager, ApplicationRoleManager roleManager)
 {
     Contract.Assert(null != userManager);
     Contract.Assert(null != roleManager);
     _userManager = userManager;
     _roleManager = roleManager;
 }
开发者ID:PF2000,项目名称:AppLabRedes,代码行数:7,代码来源:IdentityModelHelper.cs

示例5: UsersAdminController

 public UsersAdminController(
     ApplicationUserManager userManager, 
     ApplicationRoleManager roleManager)
 {
     UserManager = userManager;
     RoleManager = roleManager;
 }
开发者ID:cuongpv88,项目名称:work,代码行数:7,代码来源:UserAdminController.cs

示例6: AccountController

 public AccountController(ApplicationUserManager userManager, ApplicationSignInManager signInManager,
     ApplicationRoleManager roleManager)
 {
     UserManager = userManager;
     SignInManager = signInManager;
     RoleManager = roleManager;
 }
开发者ID:sthapa123,项目名称:PV247-Expense-manager,代码行数:7,代码来源:AccountController.cs

示例7: ApplicationGroupManager

 public ApplicationGroupManager()
 {
     _db = HttpContext.Current.GetOwinContext().Get<ApplicationDbContext>();
     _userManager = HttpContext.Current.GetOwinContext().GetUserManager<ApplicationUserManager>();
     _roleManager = HttpContext.Current.GetOwinContext().Get<ApplicationRoleManager>();
     _groupStore = new ApplicationGroupStore(_db);
 }
开发者ID:spzenk,项目名称:sfdocsamples,代码行数:7,代码来源:ApplicationGroupManager.cs

示例8: CourseTemplatesController

 public CourseTemplatesController(ApplicationDbContext context, ApplicationUserManager userManager,
     ApplicationRoleManager roleManager)
 {
     _context = context;
     _userManager = userManager;
     _roleManager = roleManager;
 }
开发者ID:rswetnam,项目名称:GoodBoating,代码行数:7,代码来源:CourseTemplatesController.cs

示例9: RolesAdminController

 public RolesAdminController(ApplicationUserManager userManager,
     ApplicationRoleManager roleManager,ApplicationPermissionManager perManager)
 {
     UserManager = userManager;
     RoleManager = roleManager;
     PermissionManager = perManager;
 }
开发者ID:khoainv,项目名称:Framework,代码行数:7,代码来源:RolesAdminController.cs

示例10: Application_Start

        protected async void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            // ユーザーとロールの初期化
            // ロールの作成
            var roleManager = new ApplicationRoleManager(new UserStore());
            await roleManager.CreateAsync(new ApplicationRole { Name = "admin" });
            await roleManager.CreateAsync(new ApplicationRole { Name = "users" });

            var userManager = new ApplicationUserManager(new UserStore());
            // 一般ユーザーの作成
            await userManager.CreateAsync(new ApplicationUser { UserName = "tanaka" }, "[email protected]");
            await userManager.AddToRoleAsync(
                (await userManager.FindByNameAsync("tanaka")).Id,
                "users");
            // 管理者の作成
            await userManager.CreateAsync(new ApplicationUser { UserName = "super_tanaka" }, "[email protected]");
            await userManager.AddToRoleAsync(
                (await userManager.FindByNameAsync("super_tanaka")).Id,
                "users");
            await userManager.AddToRoleAsync(
                (await userManager.FindByNameAsync("super_tanaka")).Id,
                "admin");

            Debug.WriteLine("-----------");
        }
开发者ID:runceel,项目名称:ASPNETIdentity,代码行数:28,代码来源:Global.asax.cs

示例11: ApplicationPermissionManager

 public ApplicationPermissionManager(ApplicationDbContext context)
 {
     _db = context;
     _userManager = new ApplicationUserManager(_db);
     _roleManager = new ApplicationRoleManager(_db);
     _permissionStore = new ApplicationPermissionStore(_db);
 }
开发者ID:khoainv,项目名称:Framework,代码行数:7,代码来源:ApplicationPermissionManager.cs

示例12: RoleMenusController

 public RoleMenusController(IRoleMenuService roleMenuService, IUnitOfWorkAsync unitOfWork, IMenuItemService menuItemService, ApplicationRoleManager roleManager)
 {
     _roleMenuService = roleMenuService;
     _menuItemService = menuItemService;
     _roleManager = roleManager;
     _unitOfWork = unitOfWork;
 }
开发者ID:huoxudong125,项目名称:MVC5-Scaffolder,代码行数:7,代码来源:RoleMenusController.cs

示例13: IdentityUnitOfWork

 public IdentityUnitOfWork(string connectionString)
 {
     db = new StoreContext(connectionString);
     UserManager = new ApplicationUserManager(new UserStore<ApplicationUser>(db));
     RoleManager = new ApplicationRoleManager(new RoleStore<ApplicationRole>(db));
     ClientManager = new ClientManager(db);
 }
开发者ID:belush,项目名称:Store,代码行数:7,代码来源:IdentityUnitOfWork.cs

示例14: AuthenticationRepository

 public AuthenticationRepository(IOwinContext owinContext)
 {
     userManager = owinContext.GetUserManager<ApplicationUserManager>();
     roleManager = owinContext.Get<ApplicationRoleManager>();
     authenticationManager = owinContext.Authentication;
     request = owinContext.Request;
 }
开发者ID:CuongDuongDuy,项目名称:SecuredToDoList,代码行数:7,代码来源:AuthenticationRepository.cs

示例15: CreateRole

 public bool CreateRole(string name)
 {
     var rm = new ApplicationRoleManager(
         new RoleStore<IdentityRole>(context));
     var idResult = rm.Create(new IdentityRole(name));
     return idResult.Succeeded;
 }
开发者ID:BenVandenberk,项目名称:EindwerkNET,代码行数:7,代码来源:IdentityModels.cs


注:本文中的ApplicationRoleManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。