Beispiel #1
0
 public EndUserRole Insert(EndUserRole endUserRole)
 {
     return(this.authorizationDBContext
            .EndUserRoles
            .Add(endUserRole)
            .Entity);
 }
        public async Task <bool> Handle(AddRoleToEndUserCommand request, CancellationToken cancellationToken)
        {
            EndUser endUser = this.endUserRepository.SelectEndUserById(request.EndUserId);
            Role    role    = this.roleRepository.SelectRoleById(request.RoleId);

            if (endUser != null && role != null)
            {
                EndUserRole endUserRole = this.endUserRepository.Insert(
                    EndUserRole.Create(endUser.EndUserId, role.RoleId));

                bool success = await this.endUserRepository.UnitOfWork.SaveEntitiesAsync();

                return(success);
            }

            return(false);
        }
Beispiel #3
0
 public void Remove(EndUserRole endUserRole)
 {
     this.authorizationDBContext
     .EndUserRoles
     .Remove(endUserRole);
 }