public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } StudyParticipation = await _context.StudyParticipation.FirstOrDefaultAsync(m => m.Id == id); if (StudyParticipation == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } StudyParticipation = await _context.StudyParticipation.FindAsync(id); if (StudyParticipation != null) { _context.StudyParticipation.Remove(StudyParticipation); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }