// POST: api/Paintings public int Post([FromBody] Painting value) { logger.Write("POST for paintings", LogLevel.INFO); if (value == null) { return(0); } return(paintingsRepository.Add(value)); }
public IHttpActionResult PostPainting(Painting painting) { _logger.Write("Post painting was called", LogLevel.INFO); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _pr.Add(painting); return(Ok(painting.Id)); }
// POST: api/Paintings public void Post([FromBody] Painting value) { db.Add(value); }
// POST api/values public int Post([FromBody] Painting painting) { return(repo.Add(painting)); }