Exemple #1
0
 public IActionResult OnGet(int id)
 {
     Prediction = _converter.ToPredictionEditModel(_predictionData.Get(id));
     if (Prediction == null)
     {
         return(NotFound());
     }
     return(Page());
 }
Exemple #2
0
        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());
        }
Exemple #3
0
        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());
        }