Ejemplo n.º 1
0
        public async Task <IEnumerable <DepartmentModel> > GetAllDepartments()
        {
            const string cacheKey = "departments";

            var cachedResponse = await _redisCacheService.GetCachedData <IEnumerable <DepartmentModel> >(cacheKey);

            if (cachedResponse != null)
            {
                return(cachedResponse);
            }

            var departments = await _misService.GetAllDepartments();

            await _redisCacheService.SetCacheData(cacheKey, departments, TimeSpan.FromSeconds(86400));

            return(departments);
        }
Ejemplo n.º 2
0
        public async Task <IEnumerable <ApplicationModel> > GetAllApplications()
        {
            const string cacheKey = "applications";

            var cachedResponse = await _redisCacheService.GetCachedData <IEnumerable <ApplicationModel> >(cacheKey);

            if (cachedResponse != null)
            {
                return(cachedResponse);
            }

            var applications = await _ssoService.GetAllApplications();

            await _redisCacheService.SetCacheData(cacheKey, applications, TimeSpan.FromSeconds(86400));

            return(applications);
        }