Beispiel #1
0
        public static async Task <T> ExecuteAsync <TProvider, T>(this IEasyCachingProviderDecorator <TProvider> decorator, Func <TProvider, Task <T> > function)
            where TProvider : class, IEasyCachingProviderBase
        {
            var provider = decorator.GetCachingProvider();

            return(await decorator.ExecuteAsync(provider, function));
        }
Beispiel #2
0
        public static T Execute <TProvider, T>(this IEasyCachingProviderDecorator <TProvider> decorator, Func <TProvider, T> function)
            where TProvider : class, IEasyCachingProviderBase
        {
            var provider = decorator.GetCachingProvider();

            return(decorator.Execute(provider, function));
        }
Beispiel #3
0
        public static void Execute <TProvider> (this IEasyCachingProviderDecorator <TProvider> decorator, Action <TProvider> action)
            where TProvider : class, IEasyCachingProviderBase
        {
            var provider = decorator.GetCachingProvider();

            decorator.Execute(provider, action);
        }
Beispiel #4
0
 protected DecoratedEasyCachingProviderBase(
     string name,
     IEasyCachingProviderDecorator <TProvider> decorator)
 {
     Name      = name ?? throw new ArgumentNullException(nameof(name));
     Decorator = decorator;
 }
Beispiel #5
0
 public DecoratedHybridCachingProvider(
     string name,
     IEasyCachingProviderDecorator <IHybridCachingProvider> decorator) : base(name, decorator)
 {
 }