public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(Investigator).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InvestigatorExists(Investigator.Id)) { return(NotFound()); } else { throw; } } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Study.Add(Study); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Investigator = await _context.Investigator.FindAsync(id); if (Investigator != null) { _context.Investigator.Remove(Investigator); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Study = await _context.Study.FindAsync(id); if (Study != null) { _context.Study.Remove(Study); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Assistant = await _context.Assistant.FindAsync(id); if (Assistant != null) { _context.Assistant.Remove(Assistant); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }