示例#1
0
 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());
 }
示例#2
0
 public void OnGet()
 {
     Memberships = membershipInMemory.GetMemberships();
 }