public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(Vehicle).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VehicleExists(Vehicle.id)) { return(NotFound()); } else { throw; } } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Ckeck.Add(Ckeck); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(string id) { if (id == null) { return(NotFound()); } Type = await _context.Type.FindAsync(id); if (Type != null) { _context.Type.Remove(Type); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(string id) { if (id == null) { return(NotFound()); } Flotilla = await _context.Flotilla.FindAsync(id); if (Flotilla != null) { _context.Flotilla.Remove(Flotilla); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(string id) { if (id == null) { return(NotFound()); } Provider = await _context.Provider.FindAsync(id); if (Provider != null) { _context.Provider.Remove(Provider); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }