Esempio n. 1
0
        public async Task <IEnumerable <Realm> > GetRealms(EfEnums.GameRegionEnum region)
        {
            return(await this.cache.GetOrCacheAsync(async() =>
            {
                var json = await this.blizzardService.GetRealmsByRegionAsync(BlizzardUtilities.GetBlizzardRegionFromEfRegion(region));

                return RealmParsing.GetRealms(json);
            },
                                                    () => this.GetKey(region)));
        }
Esempio n. 2
0
        public async Task <Realm> GetRealmAsync(string realmName, BlizzardRegion region)
        {
            var result = await this.blizzardService.GetRealmAsync(realmName, region);

            if (BlizzardService.DidGetFail(result))
            {
                return(null);
            }

            return(RealmParsing.GetSingleRealm(result));
        }