示例#1
0
 public ActionResult Post([FromBody] AvailableHotels hotel)
 {
     try
     {
         _log4net.Info("Adding hotel with id" + hotel.Id);
         return(Ok(repository.AddHotel(hotel)));
     }
     catch
     {
         _log4net.Error("Error in adding hotel with id " + hotel.Id);
         return(new NotFoundObjectResult("Not updated"));
     }
 }
示例#2
0
 public AvailableHotels AddHotel(AvailableHotels hotel)
 {
     availableHotels.Add(hotel);
     return(hotel);
 }