Пример #1
0
        public async Task <IActionResult> GetAll()
        {
            try
            {
                var tasks = await _taskStatusService.GetAllAsync();

                return(Ok(_mapper.Map <IEnumerable <TaskStatusModel> >(tasks)));
            }
            catch (ArgumentException ex)
            {
                return(BadRequest(ex.Message));
            }
            catch (Exception ex)
            {
                return(StatusCode(500, ex.Message));
            }
        }
Пример #2
0
 public PageResult <TaskStatusDto> GetTaskStatuses(ODataQueryOptions <TaskStatus> options)
 {
     return(_taskStatusService.GetAllAsync(options));
 }