コード例 #1
0
        public async Task <IActionResult> Create([Bind("film_id,film,main_director,budget")] Films films)
        {
            if (ModelState.IsValid)
            {
                _context.Add(films);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(films));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("actor_id,name,age,nationality,played_rolles")] Actors actors)
        {
            if (ModelState.IsValid)
            {
                _context.Add(actors);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(actors));
        }
コード例 #3
0
        public async Task <IActionResult> Create([Bind("genre_id,genre")] Genres genres)
        {
            if (ModelState.IsValid)
            {
                _context.Add(genres);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(genres));
        }