예제 #1
0
        protected async Task <IActionResult> Handle(DataCommand command)
        {
            try
            {
                var response = await _dataService.AddData(command);

                if (response.IsValid)
                {
                    return(Ok(response.Value));
                }
                else
                {
                    return(BadRequest(response.Message));
                }
            }
            catch (Exception ex)
            {
                return(new BadRequestObjectResult(ex));;
            }
        }