示例#1
0
 public async Task CreateGroup(GroupContract contract, string ownerId)
 {
     if ((await _repository.GetGroups(ownerId)).Any(g => g.Name == contract.Name))
     {
         throw new NameAlreadyUsedException(contract.Name);
     }
     var group = _groupModelMapper.Map(contract, ownerId);
     await _repository.AddGroup(group);
 }
示例#2
0
 public async Task <List <Group> > GetGroups()
 {
     return(await _groupsRepo.GetGroups());
 }
 public IEnumerable <Groups> GetGroups()
 {
     return(_groupsRepository.GetGroups());
 }
示例#4
0
        public async Task <IActionResult> GetAvailableGroups(string user)
        {
            var result = await _groups.GetGroups(user);

            return(Ok(result));
        }