コード例 #1
0
ファイル: TeamController.cs プロジェクト: handsofstone/hp
 public ActionResult SaveRoster(SaveRosterViewModel model)
 {
     SavePositions(model);
     return Json(true);
 }
コード例 #2
0
ファイル: TeamController.cs プロジェクト: handsofstone/hp
 public void SavePositions(SaveRosterViewModel model)
 {
     using (ApplicationDbContext context = new ApplicationDbContext())
     {
         foreach (var player in model.Players)
         {
             context.RosterPlayers.Find(model.TeamId, player.PlayerId).Position = player.Position;
         }
         context.SaveChanges();
     }
 }