Esempio n. 1
0
        public async Task <IActionResult> Create([Bind("Id,Sinopsis,Genre,Image,Rented")] Film film)
        {
            if (ModelState.IsValid)
            {
                _context.Add(film);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(film));
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([Bind("Id,Name,LastName,Email,ProfilePicture")] User user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(user));
        }
Esempio n. 3
0
        public async Task <IActionResult> Create([Bind("Id,DateRental,DateReturn")] UserFilm userFilm)
        {
            if (ModelState.IsValid)
            {
                _context.Add(userFilm);
                await _context.SaveChangesAsync();

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