public IActionResult OnGet(int passwordId) { Password = passwordData.GetPasswordById(passwordId); if (Password == null) { return(RedirectToPage("./NotFound")); } return(Page()); }
public IActionResult OnGet(int? passwordId) { if (passwordId.HasValue) { Password = passwordData.GetPasswordById(passwordId.Value); }else { Password = new Password(); } if (Password == null) { return RedirectToPage("./NotFound"); } return Page(); }