コード例 #1
0
 public IHttpActionResult Edit(int id, [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.EditCar(_car);
             auctionService.Save();
             return(Ok());
         }
         else
         {
             return(BadRequest());
         }
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.ToString()));
     }
 }