public ActionResult Create([Bind(Include = "TeamId,TeamName,City,Province,PlayerId,country")] Team team) { if (ModelState.IsValid) { db.Teams.Add(team); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(team)); }
public ActionResult Create([Bind(Include = "PlayerId,FirstName,LastName,Position")] Player player) { if (ModelState.IsValid) { db.Players.Add(player); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(player)); }
public ActionResult Create([Bind(Include = "Id,Name,TeamId,PlayerId")] Country country) { if (ModelState.IsValid) { db.countries.Add(country); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(country)); }
public ActionResult Create([Bind(Include = "PlayerId,FirstName,LastName,Position,TeamName")] Player player) { if (ModelState.IsValid) { db.Players.Add(player); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.TeamName = new SelectList(db.Teams, "TeamName", "City", player.TeamName); return(View(player)); }
public void Save() { context.SaveChanges(); }