public async Task <IActionResult> Create([Bind("Id,Model,Maker,RegistrationNumber,RentPerDay")] Bike bike)
        {
            if (ModelState.IsValid)
            {
                _context.Add(bike);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(bike));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("id,IssueDate")] Rental rental)
        {
            if (ModelState.IsValid)
            {
                _context.Add(rental);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(rental));
        }
        public async Task <IActionResult> Create([Bind("id,FirstName,LastName,Address,Phone,LicenseNo")] Customer customer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(customer));
        }