public IActionResult BusinessForm(string city, int TripId) { var viewModel = new BusinessFormVM(); viewModel.City = city; viewModel.TripID = TripId; return(View(viewModel)); }
public async Task <IActionResult> BusinessFormResult(BusinessFormVM model) { var response = await _yelpClient.GetBusinessByCity(model.City, model.Category); var viewModel = new BusinessFormResultVM(); var results = response.businesses; viewModel.Businesses = results .Select(results => new BusinessVM() { Name = results.name }) .ToList(); return(View(viewModel)); }