public object GetAllCollections() { FullInfoRepository repository = new FullInfoRepository(); var collections = repository.GetAllCollections(); return(collections); }
public void GenerateJsonPlaces() { FullInfoRepository repository = new FullInfoRepository(); var collections = repository.GetAllCollections(); foreach (dynamic collection in collections) { var name = collection["name"].ToString(); if (name.Contains("Hotel")) { var country = name.Replace("Hotel", ""); _service = new HotelService(country); var cityList = _service.GetCities(); var stateList = _service.GetStates(); var countryList = _service.GetCountry(); foreach (var city in cityList) { var local = new { cidade = city }; } } } }
public ActionResult <string> RemoveHotelFullInfo([FromRoute] string country, [FromRoute] string id) { FullInfoRepository repository = new FullInfoRepository(); repository.RemoveHotel(id, country); return(Ok()); }
public ActionResult <string> UpdateHotelFullInfo([FromBody] HotelFullInfo hotel, [FromRoute] string country, [FromRoute] string id) { FullInfoRepository repository = new FullInfoRepository(); repository.UpdateHotel(id, country, hotel); return(Ok(hotel)); }
public ActionResult <string> GetFullInfo(string id, string pais) { FullInfoRepository repository = new FullInfoRepository(); var hotel = repository.GetHotel(id, pais); if (hotel == null) { return(NotFound()); } return(Ok(hotel)); }
public ActionResult GetFullInfoList([FromBody] FilterModel filter) { if (string.IsNullOrEmpty(filter.Country) || filter.Limit == 0) { return(BadRequest()); } FullInfoRepository repository = new FullInfoRepository(); var list = repository.GetHoteis(filter); return(Ok(list)); }