public async Task <IActionResult> Create(Car car) { if (ModelState.IsValid) { await context.AddAsync(car); await context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(car)); }
public async Task AddCar(Car car) { await _context.AddAsync(car); await _context.SaveChangesAsync(); }