Exemplo n.º 1
0
        // PUT: api/Paintings/5
        public void Put(int id, [FromBody] Painting value)
        {
            logger.Write("PUT for paintings with id " + id, LogLevel.INFO);

            value.Id = id;

            paintingsRepository.Update(value);
        }
Exemplo n.º 2
0
        public IHttpActionResult PutPainting(int id, Painting Painting)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != Painting.Id)
            {
                return(BadRequest());
            }

            repo.Update(Painting);

            return(Ok(Painting));
        }
Exemplo n.º 3
0
        public IHttpActionResult PutPainting(int id, Painting painting)
        {
            _logger.Write("Put painting was called", LogLevel.INFO);
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != painting.Id)
            {
                return(BadRequest());
            }

            Painting p = _pr.Update(painting);

            if (p == null)
            {
                return(NotFound());
            }

            return(Ok());
        }
Exemplo n.º 4
0
 // PUT: api/Paintings/5
 public void Put(int id, [FromBody] Painting value)
 {
     db.Update(value);
 }
Exemplo n.º 5
0
 // PUT api/values/5
 public void Put(int id, [FromBody] Painting painting)
 {
     _logger.Write("PUT for Paintings was called", LogLevel.Info);
     painting.Id = id;
     repo.Update(painting);
 }