Show / Hide Table of Contents

Class ShortenedUrlCacheService

Inheritance
object
ShortenedUrlCacheService
Implements
ITransientDependency
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Volo.CmsKit.Public.UrlShorting
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
Type Name Description
IShortenedUrlRepository shortenedUrlRepository
IDistributedCache<ShortenedUrlCacheItem, string> shortenedUrlCache
IDistributedCache<ShortenedUrlKeysCacheItem> regexShortenedUrlCacheKeysCache
IObjectMapper objectMapper
IOptions<ShortenedUrlCacheOptions> cacheOptions
IOptions<UrlShortingOptions> urlShortingOptions

Properties

CacheOptions

Declaration
protected IOptions<ShortenedUrlCacheOptions> CacheOptions { get; }
Property Value
Type Description
IOptions<ShortenedUrlCacheOptions>

ObjectMapper

Declaration
protected IObjectMapper ObjectMapper { get; }
Property Value
Type Description
IObjectMapper

RegexShortenedUrlCacheKeysCache

Declaration
protected IDistributedCache<ShortenedUrlKeysCacheItem> RegexShortenedUrlCacheKeysCache { get; }
Property Value
Type Description
IDistributedCache<ShortenedUrlKeysCacheItem>

ShortenedUrlCache

Declaration
protected IDistributedCache<ShortenedUrlCacheItem, string> ShortenedUrlCache { get; }
Property Value
Type Description
IDistributedCache<ShortenedUrlCacheItem, string>

ShortenedUrlRepository

Declaration
protected IShortenedUrlRepository ShortenedUrlRepository { get; }
Property Value
Type Description
IShortenedUrlRepository

UrlShortingOptions

Declaration
protected IOptions<UrlShortingOptions> UrlShortingOptions { get; }
Property Value
Type Description
IOptions<UrlShortingOptions>

Methods

AddAsync(string, ShortenedUrlCacheItem)

Declaration
public virtual Task AddAsync(string source, ShortenedUrlCacheItem shortenedUrl)
Parameters
Type Name Description
string source
ShortenedUrlCacheItem shortenedUrl
Returns
Type Description
Task

AddCacheKeyAsync(string)

Declaration
protected virtual Task AddCacheKeyAsync(string key)
Parameters
Type Name Description
string key
Returns
Type Description
Task

AddCacheKeyManyAsync(List<string>)

Declaration
protected virtual Task AddCacheKeyManyAsync(List<string> keys)
Parameters
Type Name Description
List<string> keys
Returns
Type Description
Task

AddManyAsync(List<ShortenedUrl>)

Declaration
public virtual Task AddManyAsync(List<ShortenedUrl> shortenedUrls)
Parameters
Type Name Description
List<ShortenedUrl> shortenedUrls
Returns
Type Description
Task

AddRegexManyToCacheAsync(List<ShortenedUrl>)

Declaration
protected virtual Task AddRegexManyToCacheAsync(List<ShortenedUrl> shortenedUrls)
Parameters
Type Name Description
List<ShortenedUrl> shortenedUrls
Returns
Type Description
Task

AddRegexToCacheAsync(ShortenedUrlCacheItem)

Declaration
protected virtual Task AddRegexToCacheAsync(ShortenedUrlCacheItem shortenedUrl)
Parameters
Type Name Description
ShortenedUrlCacheItem shortenedUrl
Returns
Type Description
Task

CacheAllAsync()

Declaration
public virtual Task CacheAllAsync()
Returns
Type Description
Task

FindAsync(string)

Declaration
public virtual Task<ShortenedUrlCacheItem> FindAsync(string source)
Parameters
Type Name Description
string source
Returns
Type Description
Task<ShortenedUrlCacheItem>

FindFromAllRegexCacheAsync(string)

Declaration
protected virtual Task<ShortenedUrlCacheItem> FindFromAllRegexCacheAsync(string source)
Parameters
Type Name Description
string source
Returns
Type Description
Task<ShortenedUrlCacheItem>

InMemoryCacheRemoveExpired()

Declaration
protected virtual void InMemoryCacheRemoveExpired()

RegexIsMatch(string, string)

Declaration
protected virtual bool RegexIsMatch(string source, string target)
Parameters
Type Name Description
string source
string target
Returns
Type Description
bool

RemoveAsync(string)

Declaration
public virtual Task RemoveAsync(string source)
Parameters
Type Name Description
string source
Returns
Type Description
Task

RemoveCacheKeyAsync(string)

Declaration
protected virtual Task RemoveCacheKeyAsync(string key)
Parameters
Type Name Description
string key
Returns
Type Description
Task

RemoveCacheKeyManyAsync(List<string>)

Declaration
protected virtual Task RemoveCacheKeyManyAsync(List<string> keys)
Parameters
Type Name Description
List<string> keys
Returns
Type Description
Task

RemoveRegexFromCache(string)

Declaration
protected virtual Task RemoveRegexFromCache(string source)
Parameters
Type Name Description
string source
Returns
Type Description
Task

RemoveRegexManyFromCacheAsync(List<ShortenedUrlCacheItem>)

Declaration
protected virtual Task RemoveRegexManyFromCacheAsync(List<ShortenedUrlCacheItem> shortenedUrls)
Parameters
Type Name Description
List<ShortenedUrlCacheItem> shortenedUrls
Returns
Type Description
Task

Implements

ITransientDependency

Extension Methods

AbpObjectExtensions.As<T>(object)
AbpObjectExtensions.To<T>(object)
LockExtensions.Locking(object, Action)
LockExtensions.Locking<TResult>(object, Func<TResult>)
AbpObjectExtensions.If<T>(T, bool, Action<T>)
AbpObjectExtensions.If<T>(T, bool, Func<T, T>)
AbpObjectExtensions.IsIn<T>(T, IEnumerable<T>)
AbpObjectExtensions.IsIn<T>(T, params T[])
AbpQueryableExtensions.OrderByIf<T, TQueryable>(TQueryable, bool, string)
AbpQueryableExtensions.PageBy<T, TQueryable>(TQueryable, int, int)
AbpQueryableExtensions.WhereIf<T, TQueryable>(TQueryable, bool, Expression<Func<T, bool>>)
AbpQueryableExtensions.WhereIf<T, TQueryable>(TQueryable, bool, Expression<Func<T, int, bool>>)
AbpOpenIddictQueryableExtensions.SkipIf<T, TQueryable>(TQueryable, bool, int?)
AbpOpenIddictQueryableExtensions.TakeIf<T, TQueryable>(TQueryable, bool, int?)
LockExtensions.Locking<T>(T, Action<T>)
LockExtensions.Locking<T, TResult>(T, Func<T, TResult>)
In this article
Back to top Powered by ABP.IO Platform