Exemplo n.º 1
0
        public async Task <IActionResult> UpdateGroup([FromBody] UpdateGroup.Request request, Guid id)
        {
            request.Id        = id;
            request.AccountId = AccountId.GetValueOrDefault();
            request.ActionBy  = UserId.GetValueOrDefault();

            var result = await Mediator.Send(request);

            return(Respond(result));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> UpdateGroup(int id, UpdateGroup.Request request)
        {
            try {
                var response = await new UpdateGroup(_ctx).Do(id, request);
                if (response.Status)
                {
                    return(NoContent());
                }

                return(BadRequest(response.Message));
            } catch (GroupValidationException groupValidationException) {
                return(BadRequest(GetInnerMessage(groupValidationException)));
            }
        }