public IActionResult Form(Films formRes)
 {
     if (ModelState.IsValid)
     {
         _context.Films.Add(formRes);
         _context.SaveChanges();
         return(View("Confirmation", formRes));
     }
     return(View());
 }
        public ActionResult Create([Bind(Include = "FilmName, FilmLength, ReleaseDate, AgeRating, Language, FilmRating")] Film film)
        {
            if (ModelState.IsValid)
            {
                db.Films.Add(film);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(film));
        }
Example #3
0
 public ActionResult Index()
 {
     for (var i = 0; i <= 1000; i++)
     {
         db.Films.Add(new Films());
     }
     db.SaveChanges();
     return(View(db.Films));
 }
Example #4
0
 public ActionResult Edit(Films films)
 {
     _db.Entry(films).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }
 public void Add(Compte entity)
 {
     _filmRatingsDbContext.Compte.Add(entity);
     _filmRatingsDbContext.SaveChanges();
 }