コード例 #1
0
        protected override async Task <int> SaveChangesInternal()
        {
            /*            await
             *  _cache.Insert(CacheKey,
             *      encoding.GetBytes(JsonConvert.SerializeObject(this.MapTo<GameContextDto>(), Settings)));*/

            // TODO: Now we would have copies of various content spread out over the games that support content from other games :S
            foreach (var g in Games)
            {
                ConfirmConsistency(g);
                var jsonStr = JsonConvert.SerializeObject(g, Settings);
                await
                _cache.Insert(GetCacheKey(g.Id),
                              encoding.GetBytes(jsonStr));
            }

            return(-1); // TODO
        }