public async Task <IActionResult> Create([Bind("Id,Make,Model,Year,Kilometer,ImageUrl,Color,RatePerDay")] Vehicle vehicle) { if (ModelState.IsValid) { _context.Add(vehicle); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(vehicle)); }
public async Task <IActionResult> Create([Bind("Id,FirstName,LastName,Address,Phone,DrivingLicence")] Customer customer) { if (ModelState.IsValid) { _context.Add(customer); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(customer)); }