예제 #1
0
        // 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));
        }
예제 #2
0
        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));
        }
예제 #3
0
 // POST: api/Paintings
 public void Post([FromBody] Painting value)
 {
     db.Add(value);
 }
예제 #4
0
 // POST api/values
 public int Post([FromBody] Painting painting)
 {
     return(repo.Add(painting));
 }