Class ShortenedUrlCacheService
Inheritance
ShortenedUrlCacheService
Assembly: Volo.CmsKit.Pro.Public.Application.dll
Syntax
public class ShortenedUrlCacheService : ITransientDependency
Constructors
ShortenedUrlCacheService(IShortenedUrlRepository, IDistributedCache<ShortenedUrlCacheItem, string>, IDistributedCache<ShortenedUrlKeysCacheItem>, IObjectMapper, IOptions<ShortenedUrlCacheOptions>, IOptions<UrlShortingOptions>)
Declaration
public ShortenedUrlCacheService(IShortenedUrlRepository shortenedUrlRepository, IDistributedCache<ShortenedUrlCacheItem, string> shortenedUrlCache, IDistributedCache<ShortenedUrlKeysCacheItem> regexShortenedUrlCacheKeysCache, IObjectMapper objectMapper, IOptions<ShortenedUrlCacheOptions> cacheOptions, IOptions<UrlShortingOptions> urlShortingOptions)
Parameters
Properties
CacheOptions
Declaration
protected IOptions<ShortenedUrlCacheOptions> CacheOptions { get; }
Property Value
ObjectMapper
Declaration
protected IObjectMapper ObjectMapper { get; }
Property Value
RegexShortenedUrlCacheKeysCache
Declaration
protected IDistributedCache<ShortenedUrlKeysCacheItem> RegexShortenedUrlCacheKeysCache { get; }
Property Value
ShortenedUrlCache
Declaration
protected IDistributedCache<ShortenedUrlCacheItem, string> ShortenedUrlCache { get; }
Property Value
ShortenedUrlRepository
Declaration
protected IShortenedUrlRepository ShortenedUrlRepository { get; }
Property Value
UrlShortingOptions
Declaration
protected IOptions<UrlShortingOptions> UrlShortingOptions { get; }
Property Value
Methods
AddAsync(string, ShortenedUrlCacheItem)
Declaration
public virtual Task AddAsync(string source, ShortenedUrlCacheItem shortenedUrl)
Parameters
Returns
AddCacheKeyAsync(string)
Declaration
protected virtual Task AddCacheKeyAsync(string key)
Parameters
Type |
Name |
Description |
string |
key |
|
Returns
AddCacheKeyManyAsync(List<string>)
Declaration
protected virtual Task AddCacheKeyManyAsync(List<string> keys)
Parameters
Returns
AddManyAsync(List<ShortenedUrl>)
Declaration
public virtual Task AddManyAsync(List<ShortenedUrl> shortenedUrls)
Parameters
Returns
AddRegexManyToCacheAsync(List<ShortenedUrl>)
Declaration
protected virtual Task AddRegexManyToCacheAsync(List<ShortenedUrl> shortenedUrls)
Parameters
Returns
AddRegexToCacheAsync(ShortenedUrlCacheItem)
Declaration
protected virtual Task AddRegexToCacheAsync(ShortenedUrlCacheItem shortenedUrl)
Parameters
Returns
CacheAllAsync()
Declaration
public virtual Task CacheAllAsync()
Returns
FindAsync(string)
Declaration
public virtual Task<ShortenedUrlCacheItem> FindAsync(string source)
Parameters
Type |
Name |
Description |
string |
source |
|
Returns
FindFromAllRegexCacheAsync(string)
Declaration
protected virtual Task<ShortenedUrlCacheItem> FindFromAllRegexCacheAsync(string source)
Parameters
Type |
Name |
Description |
string |
source |
|
Returns
InMemoryCacheRemoveExpired()
Declaration
protected virtual void InMemoryCacheRemoveExpired()
RegexIsMatch(string, string)
Declaration
protected virtual bool RegexIsMatch(string source, string target)
Parameters
Returns
RemoveAsync(string)
Declaration
public virtual Task RemoveAsync(string source)
Parameters
Type |
Name |
Description |
string |
source |
|
Returns
RemoveCacheKeyAsync(string)
Declaration
protected virtual Task RemoveCacheKeyAsync(string key)
Parameters
Type |
Name |
Description |
string |
key |
|
Returns
RemoveCacheKeyManyAsync(List<string>)
Declaration
protected virtual Task RemoveCacheKeyManyAsync(List<string> keys)
Parameters
Returns
RemoveRegexFromCache(string)
Declaration
protected virtual Task RemoveRegexFromCache(string source)
Parameters
Type |
Name |
Description |
string |
source |
|
Returns
RemoveRegexManyFromCacheAsync(List<ShortenedUrlCacheItem>)
Declaration
protected virtual Task RemoveRegexManyFromCacheAsync(List<ShortenedUrlCacheItem> shortenedUrls)
Parameters
Returns
Implements
Extension Methods