// 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(Position).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PositionExists(Position.ID)) { return(NotFound()); } else { throw; } } return(RedirectToPage("./Index")); }
// To protect from overposting attacks, see https://aka.ms/RazorPagesCRUD public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Marks.Add(Mark); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
// To protect from overposting attacks, see https://aka.ms/RazorPagesCRUD public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.StudentProfiles.Add(StudentProfile); await _context.SaveChangesAsync(); return(RedirectToPage("./Create")); }
public async Task <IActionResult> OnPostAsync(long?id) { if (id == null) { return(NotFound()); } Contribution = await _context.contributions.FindAsync(id); if (Contribution != null) { _context.contributions.Remove(Contribution); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Fee = await _context.Fees.FindAsync(id); if (Fee != null) { _context.Fees.Remove(Fee); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(long?id) { if (id == null) { return(NotFound()); } Depositor = await _context.Publisher.FindAsync(id); if (Depositor != null) { _context.Publisher.Remove(Depositor); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }