public IActionResult GetById(int id) { var item = StuffData.GetStuff(id); if (item == null) { return(NotFound()); } return(new ObjectResult(item)); }
public IActionResult Create([FromBody] StuffItem item) { if (item == null) { return(BadRequest()); } StuffData.CreateStuff(item); item = StuffData.GetStuff(StuffData.GetMaxId()); if (item == null) { return(NotFound()); } return(new ObjectResult(item));; }
public IEnumerable <StuffItem> GetAll() { return(StuffData.GetStuff()); }