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