public IActionResult PutFoto(Int64 key, [FromBody] Models.Agriculturebd.Foto newItem) { if (newItem == null || newItem.Id != key) { return(BadRequest()); } this.OnFotoUpdated(newItem); this.context.Fotos.Update(newItem); this.context.SaveChanges(); return(new NoContentResult()); }
public IActionResult Post([FromBody] Models.Agriculturebd.Foto item) { if (item == null) { return(BadRequest()); } this.OnFotoCreated(item); this.context.Fotos.Add(item); this.context.SaveChanges(); return(Created($"odata/Agriculturebd/Fotos/{item.Id}", item)); }
partial void OnFotoUpdated(Models.Agriculturebd.Foto item);
partial void OnFotoDeleted(Models.Agriculturebd.Foto item);