public IActionResult OnGet(int id) { VerifyLogin(); void VerifyLogin() { if (HttpContext.Session.GetInt32("Login") != null) { validUser = (int)HttpContext.Session.GetInt32("Login"); } else { validUser = 0; RedirectToPage("Login"); } if (HttpContext.Session.GetString("Email") != null) { email = HttpContext.Session.GetString("Email"); } else { email = null; RedirectToPage("Login"); } } Product = catalog.GetProduct(id); return(Page()); }
public void OnGet(int id) { VerifyLogin(); product = catalog.GetProduct(id); }