public IActionResult OnGet(int?id) { if (id.HasValue) { Customer = customerInMemory.GetCustomer(id.Value); if (Customer == null) { return(RedirectToPage("/Customers/List")); } } else { Customer = new Customer(); } Memberships = membershipInMemory.GetMemberships().Select(x => new SelectListItem { Value = x.Id.ToString(), Text = x.GetMembershipType() }).ToList(); return(Page()); }
public void OnGet() { Memberships = membershipInMemory.GetMemberships(); }