示例#1
0
        public IActionResult BusinessForm(string city, int TripId)
        {
            var viewModel = new BusinessFormVM();

            viewModel.City   = city;
            viewModel.TripID = TripId;
            return(View(viewModel));
        }
示例#2
0
        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));
        }