public IActionResult OnGet(int fitnessPlanId)
 {
     FitnessPlan = planData.GetById(fitnessPlanId);
     if (FitnessPlan == null)
     {
         return(RedirectToPage("./NotFound"));
     }
     return(Page());
 }
Esempio n. 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());
 }