Example #1
0
        public async Task <T> GetByIdAsync(string id)
        {
            var result = await IEntityCacheService.GetByIdAsync <T>(id);

            if (result == null)
            {
                result = await IDatabaseService.GetByIdAsync <T>(id);

                if (result != null)
                {
                    await IEntityCacheService.SetAsync(result);
                }
            }

            return(result);
        }
Example #2
0
        public async Task <T> GetByNameAsync(string name)
        {
            var id = await IIdTranslationService.GetIdByNameAsync <T>(name);

            return(await IEntityCacheService.GetByIdAsync <T>(id));
        }
Example #3
0
        public async Task <T> GetByAutoIdAsync(ulong autoId)
        {
            var id = await IIdTranslationService.GetIdByAutoIdAsync <T>(autoId);

            return(await IEntityCacheService.GetByIdAsync <T>(id));
        }