Пример #1
0
        public ActionResult Create([Bind(Include = "TrackId,BandCDId,TrackName")] Track track)
        {
            if (ModelState.IsValid)
            {
                db.Tracks.Add(track);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.BandCDId = new SelectList(db.BandCDs, "BandCDId", "AlbumName", track.BandCDId);
            return(View(track));
        }