public ActionResult PutSupply(string replace, [FromBody] Data.Models.Supplies supply) { var found = _repository.GetSpecificMethod(replace); if (found != null) { found.Idea = supply.Idea; found.Supplies1 = supply.Supplies1; found.TaskDone = supply.TaskDone; _repository.PutMethod(found); return(NoContent()); } return(NotFound()); }
public ActionResult PostSupply([FromBody, Bind("Supplies1", "Idea")] Data.Models.Supplies supply) { var temp0 = _repository.GetMethod(); if (temp0.Count() > 0) { int temp = _repository.GetMethod().Max <Data.Models.Supplies>(e => e.Id); supply.Id = temp + 1; _repository.PostMethod(supply); } else { supply.Id = 0; _repository.PostMethod(supply); } return(NoContent()); }