public async Task <IActionResult> Create([Bind("Book_ID,Book_Title,Author,Publisher,Date_of_publish")] Book book) { if (ModelState.IsValid) { _context.Add(book); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(book)); }
public async Task <IActionResult> Create([Bind("Rental_ID,Cust_ID,Book_ID,IssueDate,ReturnDate")] Rental rental) { if (ModelState.IsValid) { _context.Add(rental); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(rental)); }
public async Task <IActionResult> Create([Bind("Cust_ID,FName,LName,Gender,DOB")] Customer customer) { if (ModelState.IsValid) { _context.Add(customer); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(customer)); }