// 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(Bucket).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BucketExists(Bucket.TypeID)) { return(NotFound()); } else { throw; } } return(RedirectToPage("/WorkGroups/Index")); }
// To protect from overposting attacks, see https://aka.ms/RazorPagesCRUD public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.WorkGroup.Add(WorkGroup); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Bucket = await _context.Bucket.FindAsync(id); if (Bucket != null) { _context.Bucket.Remove(Bucket); await _context.SaveChangesAsync(); } return(RedirectToPage("/WorkGroups/Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } WorkGroup = await _context.WorkGroup.FindAsync(id); if (WorkGroup != null) { _context.WorkGroup.Remove(WorkGroup); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Employee = await _context.Employee.FindAsync(id); if (Employee != null) { _context.Employee.Remove(Employee); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }