Exemple #1
0
        public async Task <IActionResult> Create([Bind("GenreID,GenreName")] GenreModel genreModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(genreModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(genreModel));
        }
Exemple #2
0
        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)));
            }
            return(View(MovieModel));
        }