public async Task <IActionResult> Create([Bind("Id,Make,Model,Year,Color,Engine,Price,Mileage,IsUsed,CarImage")] CarModel carModel) { if (ModelState.IsValid) { _context.Add(carModel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(carModel)); }
public async Task <IActionResult> Create([Bind("Id,Slide1,Slide2,Slide3")] HomeImage homeImage) { if (ModelState.IsValid) { _context.Add(homeImage); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(homeImage)); }
public async Task <IActionResult> Create([Bind("Id,FirstName,LastName,Email,PhoneNumber,Date,StartTime,EndTime,Message")] TestDrive testDrive) { if (ModelState.IsValid) { _context.Add(testDrive); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(testDrive)); }