コード例 #1
0
        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());
        }
コード例 #2
0
        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));
        }
コード例 #3
0
 partial void OnCompraUpdated(Models.Agriculturebd.Compra item);