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")); } }
public AvailableHotels AddHotel(AvailableHotels hotel) { availableHotels.Add(hotel); return(hotel); }