示例#1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            MovieReviewComedy = await _context.MovieReviewComedy.FirstOrDefaultAsync(m => m.MovieReviewComedyId == id);

            if (MovieReviewComedy == null)
            {
                return(NotFound());
            }
            return(Page());
        }
示例#2
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            MovieReviewComedy = await _context.MovieReviewComedy.FindAsync(id);

            if (MovieReviewComedy != null)
            {
                _context.MovieReviewComedy.Remove(MovieReviewComedy);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }