public ActionResult EditCustomer(int customerId) { var customerDataService = new CustomerDataService(); var customer = customerDataService.GetCustomerById(customerId); return(PartialView(new CustomerViewModel(customer))); }
protected override async Task OnInitializedAsync() { if (Guid.TryParse(CustomerId, out SelectedCustomerId)) { Customer = await CustomerDataService.GetCustomerById(SelectedCustomerId); SelectedCustomerTypeId = Customer.CustomerTypeId.ToString(); } var list = await CustomerTypeDataService.GetAllCustomerTypes(); CustomerTypes = new ObservableCollection <CustomerTypeVm>(list); SelectedCustomerTypeId = CustomerTypes.FirstOrDefault().CustomerTypeId.ToString(); }