public async Task <IActionResult> Create([Bind("CustomerID,CustomerName,CustomerPhoneNumber")] CustomerModel customerModel) { if (ModelState.IsValid) { _context.Add(customerModel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(customerModel)); }
public async Task <IActionResult> Create([Bind("MovieID,MovieName,MovieDescription,GenreID")] MovieModel movieModel) { if (ModelState.IsValid) { _context.Add(movieModel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["GenreID"] = new SelectList(_context.Genres, "GenreID", "GenreID", movieModel.GenreID); return(View(movieModel)); }
public void Add(Video newVideo) { _db.Add(newVideo); Commit(); }