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)); }
public void Add(Painting entity) { repository.Add(AutoMapper.Mapper.Map <Model.Painting>(entity)); }