Example #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));
        }
Example #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));
        }
Example #3
0
        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));
        }