Пример #1
0
        public GameModel getGame(GameModel partialGame)
        {
            ActiveGameDataService GameDS = new ActiveGameDataService();
            //GameModel game = new JavaScriptSerializer().Deserialize<GameModel>(GameDS.Read(partialGame.Id));
            GameModel game = JsonConvert.DeserializeObject <GameModel>(GameDS.Read(partialGame.Id));

            return(game);
        }
Пример #2
0
        public int saveGame(GameModel game)
        {
            ActiveGameDataService GameDS = new ActiveGameDataService();

            if (GameDS.Read(game.Id) != null)
            {
                GameDS.Delete(game.Id);
            }

            //return GameDS.Create(new JavaScriptSerializer().Serialize(game));
            return(GameDS.Create(JsonConvert.SerializeObject(game)));
        }