public object SetObject(string key, object value, LocalizationCacheProviderOptions options)
        {
            if (string.IsNullOrEmpty(key))
            {
                throw new ArgumentNullException(nameof(key));
            }

            if (value == null)
            {
                throw new ArgumentNullException("Cache value is null");
            }

            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            var entryOptions = new MemoryCacheEntryOptions
            {
                AbsoluteExpiration = options.AbsoluteExpiration,
                Priority           = options.Priority,
                SlidingExpiration  = options.SlidingExpiration
            };

            _memoryCache.Remove(key);
            _memoryCache.Set(key, value, entryOptions);
            _cachedItems.Add(key);

            return(value);
        }
        private async Task SetKey(string key, LocalizationCacheProviderOptions cacheProviderOption = null)
        {
            object value = null;

            using (var unitOfWork = _serviceProvider.CreateUnitOfWork())
            {
                switch (key)
                {
                case nameof(Language):
                    value = unitOfWork.Repository <Language>().ToList();
                    break;

                case nameof(Resource):
                    value = unitOfWork.Repository <Resource>().Include(k => k.Language).ToList();
                    break;
                }

                var defaultLocalizationCacheProviderOptions = new LocalizationCacheProviderOptions
                {
                    Priority           = CacheItemPriority.NeverRemove,
                    AbsoluteExpiration = new DateTimeOffset(DateTime.Now.AddMinutes(30))
                };

                SetObject(key, value, cacheProviderOption ?? defaultLocalizationCacheProviderOptions);
            }

            await Task.CompletedTask;
        }