Exemple #1
0
 public Play(int id, string info, string name, Genre genre, Author author)
 {
     Id = id;
     Info = info;
     Name = name;
     Genre = genre;
     Author = author;
     DatePlays = new List<DatePlay>();
 }
 public ActionResult Edit(Genre genre)
 {
     if (ModelState.IsValid)
     {
         db.Entry(genre).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(genre);
 }
        public ActionResult Create(Genre genre)
        {
            if (ModelState.IsValid)
            {
                db.Genres.Add(genre);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(genre);
        }