Ejemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("PersonId,Lastname,Firstname,Gender")] Person person)
        {
            if (ModelState.IsValid)
            {
                _context.Add(person);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(person));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("MovieId,Title,Duration,Description,PublicationYear,CoverImage,PreviousPart,Price,Url")] Movie movie)
        {
            if (ModelState.IsValid)
            {
                _context.Add(movie);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Edit", new { id = movie.MovieId }));
            }
            ViewData["PreviousPart"] = new SelectList(_context.Movie, "MovieId", "Title", movie.PreviousPart);
            return(View(movie));
        }