Exemplo n.º 1
0
        public async Task <IActionResult> AddService(ServicesUpsertDto dto)
        {
            var result = await _servicesService.AddAsync(dto);

            switch (result.ClientStatusCode)
            {
            case AppEnums.OperationStatus.Ok:
                return(Ok(result.ReturnedData));

            case AppEnums.OperationStatus.ValidationError:
                return(BadRequest(result.ValidationResults));

            default:
                return(BadRequest(result.ClientMessageContent));
            }
        }