コード例 #1
0
        public IHttpActionResult Post([FromBody] Painting painting)
        {
            logger.Write($"[POST] (Paintings)", LogLevel.INFO);

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var id = db.Add(painting);

            return(Ok(id));
        }
コード例 #2
0
 public void Add(Painting entity)
 {
     repository.Add(AutoMapper.Mapper.Map <Model.Painting>(entity));
 }