• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IRoleRepository类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: UserService

 public UserService(IUserAccountRepository userAccountRepository, ICustomerRepository customerRepository, IUserRoleRepository userRoleRepository, IRoleRepository roleRepository)
 {
     _customerRepository = customerRepository;
     _userRoleRepository = userRoleRepository;
     _roleRepository = roleRepository;
     _userAccountRepository = userAccountRepository;
 }
开发者ID:ngnono,项目名称:NG.FM,代码行数:7,代码来源:UserService.cs


示例2: FakeSiteUserRoleRepository

        public FakeSiteUserRoleRepository(ISiteUserRepository siteUserRepo, IRoleRepository roleRepo)
        {
            list.Add(new SiteUserRole(1, 1, 1));
            list.Add(new SiteUserRole(2, 2, 2));
            list.Add(new SiteUserRole(3, 2, 1));
            list.Add(new SiteUserRole(4, 3, 3));
            list.Add(new SiteUserRole(5, 3, 2));
            list.Add(new SiteUserRole(6, 3, 1));
            list.Add(new SiteUserRole(7, 4, 4));
            list.Add(new SiteUserRole(8, 4, 3));
            list.Add(new SiteUserRole(9, 4, 2));
            list.Add(new SiteUserRole(10, 4, 1));

            var users = siteUserRepo.Get();
            var maxUserId = users.Max(x=>x.Id);
            var minUserId = 5;
            var roles = roleRepo.Get();
            var maxRoleId = roles.Max(x=>x.Id);
            var minRoleId = roles.Min(x=>x.Id);
            for (int i = 11; i <= 20 ; i++)
            {
                var userId = (i % (maxUserId+1 - minUserId)) + minUserId;
                var roleId = (i % (maxRoleId+1 - minRoleId)) + minRoleId;
                if (!this.list.Any(x => x.RoleId == roleId && x.SiteUserId == userId))
                {
                    list.Add(new SiteUserRole(i, userId, roleId));
                }
            }
        }
开发者ID:eiu165,项目名称:Teaser,代码行数:29,代码来源:FakeSiteUserRoleRepository.cs


示例3: UserRoleListModel

 public UserRoleListModel(IRoleRepository roleRepository, IUserRoleRepository userRoleRepository, IUnitOfWork unitOfWork)
     : base()
 {
     _roleRepository = roleRepository;
     _userRoleRepository = userRoleRepository;
     _unitOfWork = unitOfWork;
 }
开发者ID:edwinsyarief,项目名称:Brawijaya-Workshop-Solution,代码行数:7,代码来源:UserRoleListModel.cs


示例4: RoleAppService

 public RoleAppService(IRoleQuery roleQuery, IRoleRepository roleRepository,
     IRoleFunctionRepository roleFunctionRepository)
 {
     _roleQuery = roleQuery;
     _roleRepository = roleRepository;
     _roleFunctionRepository = roleFunctionRepository;
 }
开发者ID:unicloud,项目名称:FRP,代码行数:7,代码来源:RoleAppService.cs


示例5: Setup

 public void Setup()
 {
     _domainService = Substitute.For<IUserDomainService>();
     _roleRepository = Substitute.For<IRoleRepository>();
     _userRepository = Substitute.For<IUserRepository>();
     _handler = new CreateAdminUserAccountCommandHandler(_domainService, _userRepository,_roleRepository);
 }
开发者ID:skroonenburg,项目名称:Skeletor,代码行数:7,代码来源:when_creating_an_admin_user_account_more_than_once.cs


示例6: TenantProvisioningService

 public TenantProvisioningService(ITenantRepository tenantRepository, IUserRepository userRepository,
     IRoleRepository roleRepository)
 {
     this._tenantRepository = tenantRepository;
     this._userRepository = userRepository;
     this._roleRepository = roleRepository;
 }
开发者ID:ZhangColin,项目名称:IDDD_Samples_by_Colin,代码行数:7,代码来源:TenantProvisioningService.cs


示例7: AuthorizationService

 public AuthorizationService(IUserRepository userRepository, IGroupRepository groupRepository,
     IRoleRepository roleRepository)
 {
     this._roleRepository = roleRepository;
     this._userRepository = userRepository;
     this._groupRepository = groupRepository;
 }
开发者ID:ZhangColin,项目名称:IDDD_Samples_by_Colin,代码行数:7,代码来源:AuthorizationService.cs


示例8: AddUsersToRoles

 public void AddUsersToRoles()
 {
     var users = Builder<User>.CreateListOfSize(2).
         TheFirst(1).With(x => x.Login = "A").
         TheLast(1).With(x => x.Login = "B").Build();
     var roles = Builder<Role>.CreateListOfSize(2).
         TheFirst(1).With(x => x.RoleName = "User").
         TheLast(1).With( x => x.RoleName = "Admin").Build();
     _userRepository = Mockery.Stub<IUserRepository>();
     _roleRepository = Mockery.Stub<IRoleRepository>();
     using (Mockery.Record())
     {
         Expect.Call(_userRepository.GetUserByLogin("A")).Return(users[0]);
         Expect.Call(_userRepository.GetUserByLogin("B")).Return(users[1]);
         Expect.Call(_roleRepository.GetRoleByRoleName("User")).Return(roles[0]);
         Expect.Call(_roleRepository.GetRoleByRoleName("Admin")).Return(roles[1]);
     }
     using (Mockery.Playback())
     {
         _roleService = new RoleService(_roleRepository, _userRepository);
         _roleService.AddUsersToRoles(new[] {"A", "B"}, new[] {"User", "Admin"});
     }
     Assert.AreEqual(users[0].Roles.Count, 2);
     Assert.AreEqual(users[1].Roles.Count, 2);
 }
开发者ID:AndreyB1990,项目名称:Task1,代码行数:25,代码来源:RoleServiceTests.cs


示例9: UserService

 public UserService(IUnitOfWork uow, IUserRepository repository, IRoleRepository roleRepository)
 {
     this.uow = uow;
     this.userRepository = repository;
     this.roleRepository = roleRepository;
     //Debug.WriteLine("service create!");
 }
开发者ID:eugeni96,项目名称:TestingSystem,代码行数:7,代码来源:UserService.cs


示例10: RoleService

 public RoleService(IRoleRepository roleRepository, ICategoryPermissionForRoleRepository categoryPermissionForRoleRepository, IPermissionRepository permissionRepository, IGlobalPermissionForRoleRepository globalPermissionForRoleRepository)
 {
     _roleRepository = roleRepository;
     _categoryPermissionForRoleRepository = categoryPermissionForRoleRepository;
     _permissionRepository = permissionRepository;
     _globalPermissionForRoleRepository = globalPermissionForRoleRepository;
 }
开发者ID:R3MUSDevPack,项目名称:Forums,代码行数:7,代码来源:RoleService.cs


示例11: AdminController

 public AdminController(ICampaignRepository campaignRepository, IRoleRepository roleRepository)
 {
     this.campaignRepository = campaignRepository;
     this.roleRepository = roleRepository;
     Mapper.CreateMap<Organization, OrganizationDetailsModel>();
     Mapper.CreateMap<OrganizationSetting, OrganizationSettingModel>();
 }
开发者ID:JordanRift,项目名称:Grassroots,代码行数:7,代码来源:AdminController.cs


示例12: UserService

 public UserService(ModelStateDictionary modelState, 
     IUserRepository userRepository, IRoleRepository roleRepository)
 {
     _modelState = modelState;
     _users = userRepository;
     _roles = roleRepository;
 }
开发者ID:gadalaavinash,项目名称:Building-a-CMS-With-ASP.NET-MVC5,代码行数:7,代码来源:UserService.cs


示例13: UserProjectRoleRelationLogic

 public UserProjectRoleRelationLogic(IUserRepository userRepository,  IUserProjectRoleRelationRepository userProjectRoleRelationRepository, IRoleRepository roleRepository, IProjectRepository projectRepository)
 {
     _userRepository = userRepository;
     _userProjectRoleRelationRepository = userProjectRoleRelationRepository;
     _roleRepository = roleRepository;
     _projectRepository = projectRepository;
 }
开发者ID:pear171902790,项目名称:Bug,代码行数:7,代码来源:UserProjectRoleRelationLogic.cs


示例14: ProfileController

 public ProfileController(IRoleRepository roleRepository, IEmployeeRepository employeeRepository, IDepartmentRepository departmentRepository, ISeatingFloorRespository seatingFloorRespository)
 {
     this.roleRepository = roleRepository;
     this.employeeRepository = employeeRepository;
     this.departmentRepository = departmentRepository;
     this.seatingFloorRespository = seatingFloorRespository;
 }
开发者ID:reedcouk,项目名称:wiki-toons,代码行数:7,代码来源:ProfileController.cs


示例15: EveOnlineService

 public EveOnlineService(
     IUnitOfWork unitOfWork,
     IEveOnlineConstellationRepository eveOnlineConstellationRepository,
     IEveOnlineTypeRepository eveOnlineTypeRepository,
     IEveOnlineRegionRepository eveOnlineRegionRepository,
     IEveOnlineSolarSystemRepository eveOnlineSolarSystemRepository,
     IGenericRepository<EveOnlineSkill> eveOnlineSkillRepository,
     IGenericRepository<EveOnlineSkillGroup> eveOnlineSkillGroupRepository,
     IGenericRepository<EveOnlineSkillTree> eveOnlineSkillTreeRepository,
     IEveOnlineRequiredSkillRepository eveOnlineRequiredSkillRepository,
     IGenericRepository<EveOnlineAttribute> eveOnlineAttributeRepository,
     IGenericRepository<UserLog> userLogRepository,
     IRoleRepository roleRepository)
 {
     UnitOfWork = unitOfWork;
     _eveOnlineConstellationRepository = eveOnlineConstellationRepository;
     _eveOnlineTypeRepository = eveOnlineTypeRepository;
     _eveOnlineRegionRepository = eveOnlineRegionRepository;
     _eveOnlineSolarSystemRepository = eveOnlineSolarSystemRepository;
     _eveOnlineSkillRepository = eveOnlineSkillRepository;
     _eveOnlineSkillGroupRepository = eveOnlineSkillGroupRepository;
     _eveOnlineSkillTreeRepository = eveOnlineSkillTreeRepository;
     _eveOnlineRequiredSkillRepository = eveOnlineRequiredSkillRepository;
     _eveOnlineAttributeRepository = eveOnlineAttributeRepository;
     _userLogRepository = userLogRepository;
     _roleRepository = roleRepository;
 }
开发者ID:BernieCook,项目名称:FallenNova,代码行数:27,代码来源:EveOnlineService.cs


示例16: FunctionService

 /// <summary>
 /// Initializes a new instance of the <see cref="FunctionService"/> class.
 /// </summary>
 /// <param name="functionRepository">
 /// The function repository.
 /// </param>
 /// <param name="userRepository">
 /// The user repository.
 /// </param>
 /// <param name="functionInRoleRepository">
 /// The function in role repository.
 /// </param>
 /// <param name="userInRoleRepository">
 /// The user in role repository.
 /// </param>
 public FunctionService(IFunctionRepository functionRepository, IUserRepository userRepository, IFunctionInRoleRepository functionInRoleRepository, IUserInRoleRepository userInRoleRepository, IRoleRepository roleRepository)
 {
     this.functionRepository = functionRepository;
     this.userRepository = userRepository;
     this.functionInRoleRepository = functionInRoleRepository;
     this.userInRoleRepository = userInRoleRepository;
     this.roleRepository = roleRepository;
 }
开发者ID:J-W-Chan,项目名称:Zrd_0001_AuthorityManagement,代码行数:23,代码来源:FunctionService.cs


示例17: AbilityAuthorizationService

 public AbilityAuthorizationService(IUserRepository userRepository, 
                                    IRoleRepository roleRepository, 
                                    IAbilityRepository abilityRepository)
 {
     _userRepository = userRepository;
     _roleRepository = roleRepository;
     _abilityRepository = abilityRepository;
 }
开发者ID:Skookum,项目名称:Hero,代码行数:8,代码来源:AbilityAuthorizationService.cs


示例18: RegistrationService

 /// <summary>
 /// Initializes a new instance of the <see cref="RegistrationService" /> class.
 /// </summary>
 /// <param name="membershipService">The membership service.</param>
 /// <param name="profileService">The profile service.</param>
 /// <param name="roleRepository">The role repository.</param>
 /// <param name="userRoleRepository">The user role repository.</param>
 public RegistrationService(IMembershipService membershipService, IProfileService profileService,
     IRoleRepository roleRepository, IUserRoleRepository userRoleRepository)
 {
     this.membershipService = membershipService;
     this.profileService = profileService;
     this.roleRepository = roleRepository;
     this.userRoleRepository = userRoleRepository;
 }
开发者ID:danghung1202,项目名称:invergrovechurch,代码行数:15,代码来源:RegistrationService.cs


示例19: AccessApplicationService

 public AccessApplicationService(ITenantRepository tenantRepository, IGroupRepository groupRepository,
     IUserRepository userRepository, IRoleRepository roleRepository)
 {
     this._groupRepository = groupRepository;
     this._roleRepository = roleRepository;
     this._tenantRepository = tenantRepository;
     this._userRepository = userRepository;
 }
开发者ID:ZhangColin,项目名称:IDDD_Samples_by_Colin,代码行数:8,代码来源:AccessApplicationService.cs


示例20: RoleManager

        public RoleManager(IRoleRepository roleRepository, IAccountRepository accountRepository)
        {
            if (roleRepository == null) throw new ArgumentNullException("roleRepository");
            if (accountRepository == null) throw new ArgumentNullException("accountRepository");

            m_RoleRepository = roleRepository;
            m_AccountRepository = accountRepository;
        }
开发者ID:yaoyel,项目名称:Finework,代码行数:8,代码来源:RoleManager.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IRoleService类代码示例发布时间:2022-05-24
下一篇:
C# IRole类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap