Exemplo n.º 1
0
 public IHttpActionResult Edit(int id, [FromBody] CategoryViewModel category)
 {
     try
     {
         if (category != null)
         {
             CategoryDTO _category = new CategoryDTO {
                 Id = category.Id, Name = category.Name, Desc = category.Desc
             };
             auctionService.EditCategory(_category);
             auctionService.Save();
             return(Ok());
         }
         else
         {
             return(BadRequest());
         }
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.ToString()));
     }
 }