Beispiel #1
0
        public async Task <ActionResult <ICollection <TodoItemDto> > > GetAllAsync()
        {
            var res = await _service.GetAllAsync();

            if (res == null)
            {
                return(BadRequest());
            }

            return(Ok(res));
        }
Beispiel #2
0
        public async Task <ActionResult <IEnumerable <TodoItemDTO> > > GetAllAsync()
        {
            try
            {
                IEnumerable <TodoItemDTO> items = await _service.GetAllAsync();

                if (items == null)
                {
                    return(NotFound());
                }

                return(StatusCode(200, items));
            }
            catch (Exception e)
            {
                return(BadRequest(e));
            }
        }
        public async Task <ActionResult <List <TodoItem> > > GetAll()
        {
            var items = await _todoItemService.GetAllAsync();

            return(items);
        }