コード例 #1
0
        public async Task <IActionResult> Get(int id)
        {
            try
            {
                var task = await _taskStatusService.GetByIdAsync(id);

                return(Ok(_mapper.Map <TaskStatusModel>(task)));
            }
            catch (ArgumentException ex)
            {
                return(BadRequest(ex.Message));
            }
            catch (Exception ex)
            {
                return(StatusCode(500, ex.Message));
            }
        }