public ActionResult Create([Bind(Include = "Id,Name,Formed")] Band band)
        {
            if (ModelState.IsValid)
            {
                db.Bands.Add(band);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(band));
        }
Esempio n. 2
0
        public ActionResult Create([Bind(Include = "Id,BandId,Title,ReleaseDate")] Album album)
        {
            if (ModelState.IsValid)
            {
                db.Albums.Add(album);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(album));
        }
Esempio n. 3
0
        public ActionResult Create([Bind(Include = "Id,AlbumId,Title,Length")] Track track)
        {
            if (ModelState.IsValid)
            {
                db.Tracks.Add(track);
                db.SaveChanges();
                return(RedirectToAction("Index", "Album"));
            }

            return(RedirectToAction("Index", "Album"));
        }