public async Task <IActionResult> Index() { var model = new CustomerManagementViewModel { Customers = await _customerManagementAPI.GetCustomers() }; return(View(model)); }
public async Task <IActionResult> Index() { return(await _resiliencyHelper.ExecuteResilient(async() => { var model = new CustomerManagementViewModel { Customers = await _customerManagementAPI.GetCustomers() }; return View(model); }, View("Offline", new CustomerManagementOfflineViewModel()))); }
public async Task <IActionResult> Index() { return(await ExecuteWithFallback(async() => { var model = new CustomerManagementViewModel { Customers = await _customerManagementAPI.GetCustomers() }; return View(model); })); }
public async Task <IActionResult> Edit(string licenseNumber) { return(await _resiliencyHelper.ExecuteResilient(async() => { // get customerlist var customers = await _customerManagementAPI.GetCustomers(); Vehicle vehicle = await _vehicleManagementAPI.GetVehicleByLicenseNumber(licenseNumber); Customer customer = await _customerManagementAPI.GetCustomerById(vehicle.OwnerId); var model = new VehicleManagementEditViewModel { Vehicle = vehicle, SelectedCustomerId = customer.CustomerId, Customers = customers.Select(c => new SelectListItem { Value = c.CustomerId, Text = c.Name }) }; return View(model); }, View("Offline", new VehicleManagementOfflineViewModel()))); }
public async Task <IActionResult> New() { return(await ExecuteWithFallback(async() => { // get customerlist var customers = await _customerManagementAPI.GetCustomers(); var model = new VehicleManagementNewViewModel { Vehicle = new Vehicle(), Customers = customers.Select(c => new SelectListItem { Value = c.CustomerId, Text = c.Name }) }; return View(model); })); }
public async Task <IActionResult> New() { return(await _resiliencyHelper.ExecuteResilient(async() => { // get customerlist var customers = await _customerManagementAPI.GetCustomers(); var model = new VehicleManagementNewViewModel { Vehicle = new Vehicle(), Customers = customers.Select(c => new SelectListItem { Value = c.CustomerId, Text = c.Name }) }; return View(model); }, View("Offline", new VehicleManagementOfflineViewModel()))); }
public async Task <List <Customer> > GetCustomers() { return(await _restClient.GetCustomers()); }