// To protect from overposting attacks, enable the specific properties you want to bind to, for // more details, see https://aka.ms/RazorPagesCRUD. public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(MeetingSpeaker).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MeetingSpeakerExists(MeetingSpeaker.MeetingSpeakerID)) { return(NotFound()); } else { throw; } } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Meeting.Add(Meeting); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } MeetingSpeaker = await _context.MeetingSpeaker.FindAsync(id); if (MeetingSpeaker != null) { _context.MeetingSpeaker.Remove(MeetingSpeaker); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }