Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public async Task <T> GetByNameAsync(string name)
        {
            var id = await IIdTranslationService.GetIdByNameAsync <T>(name);

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

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