Ejemplo n.º 1
0
 public IHttpActionResult Create([FromBody] CarViewModel car)
 {
     try
     {
         if (car != null)
         {
             var _car = new CarDTO {
                 Id = car.Id, Name = car.Name, ShortDesc = car.ShortDesc, LongDesc = car.LongDesc, Price = car.Price, Date = car.Date, Img = car.Img, IsCheck = car.IsCheck, UserName = car.UserName
             };
             auctionService.CreateCar(_car);
             auctionService.Save();
             return(Ok());
         }
         else
         {
             return(BadRequest());
         }
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.ToString()));
     }
 }