public async Task <ActionResult <Todo> > GetById(long id) { var todo = await _service.GetById(id); if (todo == null) { return(NotFound()); } return(todo); }
public ActionResult <Todo> GetById(string todosId) { try { return(Ok(_service.GetById(todosId))); } catch (System.Exception err) { return(BadRequest(err.Message)); } }
public ActionResult <Todo> GetAll(int id) { try { return(Ok(_service.GetById(id))); } catch (Exception e) { return(BadRequest(e.Message)); } }