Пример #1
0
 public IActionResult OnGet(int fitnessPlanId)
 {
     FitnessPlan = planData.GetById(fitnessPlanId);
     if (FitnessPlan == null)
     {
         return(RedirectToPage("./NotFound"));
     }
     return(Page());
 }
Пример #2
0
 public IActionResult OnGet(int?fitnessPlanId)
 {
     if (fitnessPlanId.HasValue)
     {
         FitnessPlan = planData.GetById(fitnessPlanId.Value);
     }
     else
     {
         FitnessPlan = new FitnessPlan();
         FitnessPlan.CustomerName = "New user";
     }
     if (FitnessPlan == null)
     {
         return(RedirectToPage("./NotFound"));
     }
     return(Page());
 }