public async Task <UserDto> GetUserByIdAsync(Guid id)
        {
            UserDto user = UserConverter.Convert(await _userRepo.GetByIdAsync(id));

            user.Administration = AdministrationConverter.Convert(await _adminRepo.GetByUserIdAsync(id));
            user.Participant    = ParticipantConverter.Convert(await _participantRepo.GetByUserIdAsync(id));
            return(user);
        }
        public async Task <DirectionDto> GetDirectionByIdAsync(Guid id)
        {
            DirectionDto direction = DirectionConverter.Convert(await _directionRepo.GetByIdAsync(id));

            direction.Administration = AdministrationConverter.Convert(await _adminRepo.GetByDirectionIdAsync(id));
            direction.Courses        = CourseConverter.Convert(await _courseRepo.GetByDirectionIdAsync(id));
            return(direction);
        }
        public async Task <AdministrationDto> GetAdministrationByIdAsync(Guid userId, Guid directionId)
        {
            AdministrationDto admin = AdministrationConverter.Convert(await _adminRepo.GetByIdAsync(userId, directionId));

            admin.DirectionName = _directionRepo.GetByIdAsync(admin.DirectionId).Result.Name;
            admin.RoleName      = _adminRoleRepo.GetByIdAsync(admin.AdministrationRoleId).Result.Name;
            admin.UserName      = _userRepo.GetByIdAsync(admin.UserId).Result.Name;
            return(admin);
        }
 public async Task <bool> UpdateAdministrationAsync(AdministrationDto item)
 {
     return(await _adminRepo.UpdateAsync(AdministrationConverter.Convert(item)));
 }
 public async Task <AdministrationDto> CreateAdministrationAsync(AdministrationDto item)
 {
     return(AdministrationConverter.Convert(await _adminRepo.CreateAsync(AdministrationConverter.Convert(item))));
 }
 public async Task <List <AdministrationDto> > GetAdministrationByRoleIdAsync(Guid id)
 {
     return(AdministrationConverter.Convert(await _adminRepo.GetByRoleIdAsync(id)));
 }
 public async Task <List <AdministrationDto> > GetAllAdministrationAsync()
 {
     return(AdministrationConverter.Convert(await _adminRepo.GetAllAsync()));
 }