public ActionResult Edit(StadiumsTeam stadiumsteam)
 {
     if (ModelState.IsValid)
     {
         db.StadiumsTeams.Attach(stadiumsteam);
         db.ObjectStateManager.ChangeObjectState(stadiumsteam, EntityState.Modified);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.StadiumID = new SelectList(db.Stadiums, "StadiumID", "Name", stadiumsteam.StadiumID);
     ViewBag.TeamID = new SelectList(db.Teams, "TeamID", "Name", stadiumsteam.TeamID);
     return View(stadiumsteam);
 }
        public ActionResult Create(StadiumsTeam stadiumsteam)
        {
            if (ModelState.IsValid)
            {
                db.StadiumsTeams.AddObject(stadiumsteam);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.StadiumID = new SelectList(db.Stadiums, "StadiumID", "Name", stadiumsteam.StadiumID);
            ViewBag.TeamID = new SelectList(db.Teams, "TeamID", "Name", stadiumsteam.TeamID);
            return View(stadiumsteam);
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the StadiumsTeams EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToStadiumsTeams(StadiumsTeam stadiumsTeam)
 {
     base.AddObject("StadiumsTeams", stadiumsTeam);
 }
 /// <summary>
 /// Create a new StadiumsTeam object.
 /// </summary>
 /// <param name="stadiumID">Initial value of the StadiumID property.</param>
 /// <param name="teamID">Initial value of the TeamID property.</param>
 /// <param name="fromDate">Initial value of the FromDate property.</param>
 public static StadiumsTeam CreateStadiumsTeam(global::System.Int32 stadiumID, global::System.Int32 teamID, global::System.DateTime fromDate)
 {
     StadiumsTeam stadiumsTeam = new StadiumsTeam();
     stadiumsTeam.StadiumID = stadiumID;
     stadiumsTeam.TeamID = teamID;
     stadiumsTeam.FromDate = fromDate;
     return stadiumsTeam;
 }