public async Task <IActionResult> Create([Bind("Id,VehicleModel,Registration,Owner,Apartment")] Vehicle vehicle) { if (ModelState.IsValid) { _context.Add(vehicle); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(vehicle)); }
// GET: Permits public async Task <IActionResult> Index() { var parkingDataBaseContext = _context.Permit.Include(p => p.Vehicle); Fee(); await _context.SaveChangesAsync(); NumValid(); NumLapsed(); return(View(await parkingDataBaseContext.ToListAsync())); }