public async Task <IActionResult> GetAllByCreatorId([FromRoute] string creatorId) { var query = new GetAllByCreatorIdQuery(creatorId); var result = await _mediator.Send(query); return(result != null?Ok(result) : NotFound()); }
public async Task <IEnumerable <GroupResponse> > Handle(GetAllByCreatorIdQuery request, CancellationToken cancellationToken) { var domainGroups = await _groupRepository.GetAllGroupsByCreatorIdAsync(request.Id); return(domainGroups.Any() ? _mapper.Map <IEnumerable <Group>, IEnumerable <GroupResponse> >(domainGroups) : null); }