public JsonResult Get(string longitude, string latitude, string radius, string startDate) { var searchRequest = new HotelSearchRequest() { Longitude = longitude, Latitude = latitude, Radius = Convert.ToInt32(radius), StartDate = DateTime.Now }; var hotelService = new HotelBedsHotelService(); var searchResponse = hotelService.Search(searchRequest); return(Json(searchResponse)); }
// GET api/values public HotelSearchResponse Get(string latitude, string longitude, int radius, string startDate) { var hotelRequest = new HotelSearchRequest() { Radius = radius, StartDate = DateTime.ParseExact(startDate, "yyyy-MM-dd", CultureInfo.InvariantCulture), Latitude = latitude, Longitude = longitude }; var hotelService = new HotelBedsHotelService(); var response = hotelService.Search(hotelRequest); return(response); }