// GET api/values/5 public IEnumerable<TreeInventoryModel> Get(int id) { try { InventoryService service = new InventoryService(); return service.GetTreeInventoryByEstateName(id); } catch (Exception ex) { var response = ControllerContext.Request.CreateResponse(HttpStatusCode.NotFound); throw new HttpResponseException(response); } }
// POST api/values public HttpStatusCode Post([FromBody]TreeInventoryModel inventory) { InventoryService service = new InventoryService(); return service.SaveInventory(inventory); }