public async Task <ActionResult> UpgradeSubscription(string customerId, string subscriptionId) { // if no ids provided, redirect to list if (string.IsNullOrEmpty(customerId) || string.IsNullOrEmpty(subscriptionId)) { return(RedirectToAction("Index")); } else { CustomerSubscriptionUpgradeViewModel viewModel = new CustomerSubscriptionUpgradeViewModel(); // get customer & add to viewmodel var customer = await MyCustomerRepository.GetCustomer(customerId); viewModel.Customer = customer; // get subscription var subscription = await MySubscriptionRepository.GetSubscription(customerId, subscriptionId); viewModel.CustomerSubscription = subscription; // get upgrade options var upgrades = await MySubscriptionRepository.GetUpgradeOptions(customerId, subscriptionId); List <SelectListItem> upgadeOptions = new List <SelectListItem>(); foreach (var upgrade in upgrades) { upgadeOptions.Add(new SelectListItem { Text = string.Format("Upgrade to offer '{0}' - Option: {1}", upgrade.TargetOfferName, upgrade.UpgradeType), Value = string.Format("{0}|{1}", upgrade.TargetOfferId, upgrade.UpgradeType) }); } viewModel.UpgradeOptions = upgadeOptions; return(View(viewModel)); } }