示例#1
0
        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());
        }
示例#2
0
        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);
        }