public async Task <IActionResult> Create([Bind("Id,MovieName,MovieDescription,GenreID")] MovieModel movieModel) { if (ModelState.IsValid) { _context.Add(movieModel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(movieModel)); }
public async Task <IActionResult> Create([Bind("Id,RentalID,MovieID,CustomerID,RentalDate,DueDate,ReturnDate")] RentalRecordModel rentalRecordModel) { if (ModelState.IsValid) { _context.Add(rentalRecordModel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(rentalRecordModel)); }
public async Task <IActionResult> Create([Bind("Id,CustomerName,CustomerPhone")] CustomerModel customerModel) { if (ModelState.IsValid) { _context.Add(customerModel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(customerModel)); }