public IActionResult PutCompra(Int64 key, [FromBody] Models.Agriculturebd.Compra newItem)
        {
            if (newItem == null || newItem.Id != key)
            {
                return(BadRequest());
            }

            this.OnCompraUpdated(newItem);
            this.context.Compras.Update(newItem);
            this.context.SaveChanges();

            return(new NoContentResult());
        }
        public IActionResult Post([FromBody] Models.Agriculturebd.Compra item)
        {
            if (item == null)
            {
                return(BadRequest());
            }

            this.OnCompraCreated(item);
            this.context.Compras.Add(item);
            this.context.SaveChanges();

            return(Created($"odata/Agriculturebd/Compras/{item.Id}", item));
        }
 partial void OnCompraUpdated(Models.Agriculturebd.Compra item);