public IActionResult PutCategorium(int key, [FromBody] Models.Agriculturebd.Categorium newItem) { if (newItem == null || newItem.Id != key) { return(BadRequest()); } this.OnCategoriumUpdated(newItem); this.context.Categoria.Update(newItem); this.context.SaveChanges(); return(new NoContentResult()); }
public IActionResult Post([FromBody] Models.Agriculturebd.Categorium item) { if (item == null) { return(BadRequest()); } this.OnCategoriumCreated(item); this.context.Categoria.Add(item); this.context.SaveChanges(); return(Created($"odata/Agriculturebd/Categoria/{item.Id}", item)); }
partial void OnCategoriumUpdated(Models.Agriculturebd.Categorium item);