Esempio n. 1
0
        public async Task <Call> GetCallByIdAsync(int callId, bool bypassCache = true)
        {
            async Task <Call> getCall()
            {
                return(await _callsRepository.GetByIdAsync(callId));
            }

            if (!bypassCache && Config.SystemBehaviorConfig.CacheEnabled)
            {
                return(await _cacheProvider.RetrieveAsync(string.Format(CacheKey, callId), getCall, CacheLength));
            }

            return(await getCall());
        }