public static string Serialize(StoredGameData obj) { return(JsonConvert.SerializeObject(obj, new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.Auto })); }
private StoredGameData PrepareGameDataToPersist(IGame game) { StoredGameData gameData = _gameDataPersistMapper.Map(game); gameData.Items = game.Items.Select(_ => _fundsDriverPersistMapper.Map(_)).ToArray(); game.ModifiedFundsDrivers.Clear(); return(gameData); }
public void StoreGameDataForUser(string userId, StoredGameData gameData) { using (var proxy = new TInfrastructureProxy()) { var channel = proxy.CreateChannel(_endpoint); channel.StoreGameDataForUser(userId, gameData); proxy.CloseChannel(); } }