Esempio n. 1
0
        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());
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
 partial void OnCategoriumUpdated(Models.Agriculturebd.Categorium item);