Esempio n. 1
0
        public async Task <IActionResult> OnPostAsync()
        {
            var course = await _context.GetCourseAsync(Event.CourseID);

            await CheckRole(_context, _userManager, course.Pair.JoinCode);

            var success = await _context.DeleteEventAsync(Event.EventID);

            if (!success || !IsMentor)
            {
                return(RedirectToPage("/Error"));
            }

            return(RedirectToPage("/Mentor/Course/Index", new { id = Event.CourseID }));
        }