예제 #1
0
        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));
        }
예제 #2
0
        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));
        }
예제 #3
0
        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));
        }