示例#1
0
        public ActionResult Create(League league)
        {
            if (ModelState.IsValid)
            {
              _repo.AddLeague(league);
              return RedirectToAction("Index");
            }

            return View(league);
        }
示例#2
0
 /// <summary>
 /// Create a new League object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="description">Initial value of the Description property.</param>
 public static League CreateLeague(global::System.Int32 id, global::System.String name, global::System.String description)
 {
     League league = new League();
     league.Id = id;
     league.Name = name;
     league.Description = description;
     return league;
 }
示例#3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Leagues EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToLeagues(League league)
 {
     base.AddObject("Leagues", league);
 }
示例#4
0
 public int AddLeague(League league)
 {
     _context.Leagues.Add(league);
       return Save();
 }
示例#5
0
 public ActionResult Edit(League league)
 {
     if (ModelState.IsValid)
     {
         db.Entry(league).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(league);
 }