public IActionResult OnGet(int id) { Prediction = _converter.ToPredictionEditModel(_predictionData.Get(id)); if (Prediction == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnGetAsync(int id) { Prediction = _predictionData.Get(id); if (Prediction == null) { return(NotFound()); } var isAuthorized = await AuthorizationService.AuthorizeAsync( User, Prediction, PouleOperations.Delete); if (!isAuthorized.Succeeded) { return(new ChallengeResult()); } return(Page()); }
public async Task <IActionResult> OnGetAsync(int id) { Prediction = _predictionConverter.ToPredictionEditModel(_predictionData.Get(id)); Id = id; if (Prediction == null) { return(RedirectToAction("Index", "Home")); } // var isAuthorized = await AuthorizationService.AuthorizeAsync( // User, Prediction, // PouleOperations.Update); // if (!isAuthorized.Succeeded) // return new ChallengeResult(); return(Page()); }