public ActionResult Create(Tournament tournament)
        {
            if (ModelState.IsValid)
            {
                db.Tournaments.AddObject(tournament);
                db.SaveChanges();
                return PartialView("GridData", new Tournament[] { tournament });
            }

            ViewBag.AssociationID = new SelectList(db.FootballAssociations, "AssociationID", "Name", tournament.AssociationID);
            return PartialView("Edit", tournament);
        }
        public ActionResult Edit(Tournament tournament)
        {
            if (ModelState.IsValid)
            {
                db.Tournaments.Attach(tournament);
                db.ObjectStateManager.ChangeObjectState(tournament, EntityState.Modified);
                db.SaveChanges();
                return PartialView("GridData", new Tournament[] { tournament });
            }

            ViewBag.AssociationID = new SelectList(db.FootballAssociations, "AssociationID", "Name", tournament.AssociationID);
            return PartialView(tournament);
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the Tournaments EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToTournaments(Tournament tournament)
 {
     base.AddObject("Tournaments", tournament);
 }
 /// <summary>
 /// Create a new Tournament object.
 /// </summary>
 /// <param name="tournamentID">Initial value of the TournamentID property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 public static Tournament CreateTournament(global::System.Int32 tournamentID, global::System.String name)
 {
     Tournament tournament = new Tournament();
     tournament.TournamentID = tournamentID;
     tournament.Name = name;
     return tournament;
 }