Exemplo n.º 1
0
 public ActionResult Post([FromBody] BookInVO book)
 {
     try
     {
         var _entity = book.CreateEntity();
         _bookBusiness.Create(ref _entity);
         var _result = _entity.CreateVO <Book, BookOutVO>();
         return(Accepted(_result));
     }
     catch (Exception ex)
     {
         return(this.ReturnActionResult(ex));
     }
 }
Exemplo n.º 2
0
 public ActionResult Put(long id, [FromBody] BookInVO book)
 {
     try
     {
         var _entity = book.CreateEntity();
         _entity.Id = id;
         _bookBusiness.Update(ref _entity);
         var _result = _entity.CreateVO <Book, BookOutVO>();
         return(Ok(_result));
     }
     catch (Exception ex)
     {
         return(this.ReturnActionResult(ex));
     }
 }