예제 #1
0
        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());
        }
예제 #2
0
        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));
        }
예제 #3
0
 partial void OnFotoUpdated(Models.Agriculturebd.Foto item);
예제 #4
0
 partial void OnFotoDeleted(Models.Agriculturebd.Foto item);