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