public IActionResult PutInsumo(Int64 key, [FromBody] Models.Agriculturebd.Insumo newItem) { if (newItem == null || newItem.Id != key) { return(BadRequest()); } this.OnInsumoUpdated(newItem); this.context.Insumos.Update(newItem); this.context.SaveChanges(); return(new NoContentResult()); }
public IActionResult Post([FromBody] Models.Agriculturebd.Insumo item) { if (item == null) { return(BadRequest()); } this.OnInsumoCreated(item); this.context.Insumos.Add(item); this.context.SaveChanges(); return(Created($"odata/Agriculturebd/Insumos/{item.Id}", item)); }
partial void OnInsumoUpdated(Models.Agriculturebd.Insumo item);