本文整理汇总了C#中IRoleRepository类的典型用法代码示例。如果您正苦于以下问题:C# IRoleRepository类的具体用法?C# IRoleRepository怎么用?C# IRoleRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IRoleRepository类属于命名空间,在下文中一共展示了IRoleRepository类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UserService
public UserService(IUserAccountRepository userAccountRepository, ICustomerRepository customerRepository, IUserRoleRepository userRoleRepository, IRoleRepository roleRepository)
{
_customerRepository = customerRepository;
_userRoleRepository = userRoleRepository;
_roleRepository = roleRepository;
_userAccountRepository = userAccountRepository;
}
示例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));
}
}
}
示例3: UserRoleListModel
public UserRoleListModel(IRoleRepository roleRepository, IUserRoleRepository userRoleRepository, IUnitOfWork unitOfWork)
: base()
{
_roleRepository = roleRepository;
_userRoleRepository = userRoleRepository;
_unitOfWork = unitOfWork;
}
示例4: RoleAppService
public RoleAppService(IRoleQuery roleQuery, IRoleRepository roleRepository,
IRoleFunctionRepository roleFunctionRepository)
{
_roleQuery = roleQuery;
_roleRepository = roleRepository;
_roleFunctionRepository = roleFunctionRepository;
}
示例5: Setup
public void Setup()
{
_domainService = Substitute.For<IUserDomainService>();
_roleRepository = Substitute.For<IRoleRepository>();
_userRepository = Substitute.For<IUserRepository>();
_handler = new CreateAdminUserAccountCommandHandler(_domainService, _userRepository,_roleRepository);
}
示例6: TenantProvisioningService
public TenantProvisioningService(ITenantRepository tenantRepository, IUserRepository userRepository,
IRoleRepository roleRepository)
{
this._tenantRepository = tenantRepository;
this._userRepository = userRepository;
this._roleRepository = roleRepository;
}
示例7: AuthorizationService
public AuthorizationService(IUserRepository userRepository, IGroupRepository groupRepository,
IRoleRepository roleRepository)
{
this._roleRepository = roleRepository;
this._userRepository = userRepository;
this._groupRepository = groupRepository;
}
示例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);
}
示例9: UserService
public UserService(IUnitOfWork uow, IUserRepository repository, IRoleRepository roleRepository)
{
this.uow = uow;
this.userRepository = repository;
this.roleRepository = roleRepository;
//Debug.WriteLine("service create!");
}
示例10: RoleService
public RoleService(IRoleRepository roleRepository, ICategoryPermissionForRoleRepository categoryPermissionForRoleRepository, IPermissionRepository permissionRepository, IGlobalPermissionForRoleRepository globalPermissionForRoleRepository)
{
_roleRepository = roleRepository;
_categoryPermissionForRoleRepository = categoryPermissionForRoleRepository;
_permissionRepository = permissionRepository;
_globalPermissionForRoleRepository = globalPermissionForRoleRepository;
}
示例11: AdminController
public AdminController(ICampaignRepository campaignRepository, IRoleRepository roleRepository)
{
this.campaignRepository = campaignRepository;
this.roleRepository = roleRepository;
Mapper.CreateMap<Organization, OrganizationDetailsModel>();
Mapper.CreateMap<OrganizationSetting, OrganizationSettingModel>();
}
示例12: UserService
public UserService(ModelStateDictionary modelState,
IUserRepository userRepository, IRoleRepository roleRepository)
{
_modelState = modelState;
_users = userRepository;
_roles = roleRepository;
}
示例13: UserProjectRoleRelationLogic
public UserProjectRoleRelationLogic(IUserRepository userRepository, IUserProjectRoleRelationRepository userProjectRoleRelationRepository, IRoleRepository roleRepository, IProjectRepository projectRepository)
{
_userRepository = userRepository;
_userProjectRoleRelationRepository = userProjectRoleRelationRepository;
_roleRepository = roleRepository;
_projectRepository = projectRepository;
}
示例14: ProfileController
public ProfileController(IRoleRepository roleRepository, IEmployeeRepository employeeRepository, IDepartmentRepository departmentRepository, ISeatingFloorRespository seatingFloorRespository)
{
this.roleRepository = roleRepository;
this.employeeRepository = employeeRepository;
this.departmentRepository = departmentRepository;
this.seatingFloorRespository = seatingFloorRespository;
}
示例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;
}