public TicTacToe MakeMove(int id, PlayResultViewModel viewModel)
        {
            var game = DB.Load<TicTacToe>(id);
            game.MakeMove(viewModel.MoveX, viewModel.MoveY, viewModel.Move);
            DB.SaveChanges();

            Clients.Others.moveMade(game);
            return game;
        }
 public ActionResult Game(int id, PlayResultViewModel viewModel)
 {
     var game = DB.Load<TicTacToe>(id);
     try
     {
         game.MakeMove(viewModel.MoveX, viewModel.MoveY, viewModel.Move);
         return Json(game, JsonRequestBehavior.AllowGet);
     }
     catch (Exception ex)
     {
         Response.StatusCode = 400;
         return Json(ex.Message, JsonRequestBehavior.AllowGet);
     }
 }
        public ActionResult Play(int id, PlayResultViewModel viewModel)
        {
            var game = DB.Load<TicTacToe>(id);
            try
            {
                game.MakeMove(viewModel.MoveX, viewModel.MoveY, viewModel.Move);
                return RedirectToAction("Play");

            }
            catch (Exception ex)
            {
                return View(new PlayRequestViewModel
                {
                    Game = game,
                    IsTurn = game.IsTurn(UserName),
                    ErrorMessage = ex.Message
                });
            }
        }