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); }
public async Task <List <Group> > GetGroups() { return(await _groupsRepo.GetGroups()); }
public IEnumerable <Groups> GetGroups() { return(_groupsRepository.GetGroups()); }
public async Task <IActionResult> GetAvailableGroups(string user) { var result = await _groups.GetGroups(user); return(Ok(result)); }