Ejemplo n.º 1
0
        DistributedCacheRegistration(StackTrace stackTrace, string name, DistributedCacheEntryOptions entryOptions, DistributedCacheItemBuilder builder, DistributedCacheItemBuilderAsync builderAsync, Func <object, object[], string[]> cacheTags)
        {
            if (builder == null && builderAsync == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }
            var parentName = stackTrace.GetFrame(1).GetMethod().DeclaringType.FullName;

            Name         = $"{parentName}:{name}";
            EntryOptions = entryOptions ?? new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromMinutes(90));
            Builder      = builder;
            BuilderAsync = builderAsync;
            CacheTags    = cacheTags;
        }
Ejemplo n.º 2
0
 public DistributedCacheRegistration(string name, DistributedCacheEntryOptions entryOptions, DistributedCacheItemBuilderAsync builder, Func <object, object[], string[]> cacheTags)
     : this(new StackTrace(), name, entryOptions, null, builder, cacheTags)
 {
 }
Ejemplo n.º 3
0
 public DistributedCacheRegistration(string name, int minuteTimeout, DistributedCacheItemBuilderAsync builder, params string[] cacheTags)
     : this(new StackTrace(), name, new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromMinutes(minuteTimeout)), null, builder, cacheTags != null && cacheTags.Length > 0 ? (a, b) => cacheTags : (Func <object, object[], string[]>)null)
 {
 }
Ejemplo n.º 4
0
 public DistributedCacheRegistration(string name, int minuteTimeout, DistributedCacheItemBuilderAsync builder, Func <object, object[], string[]> cacheTags)
     : this(new StackTrace(), name, new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromMinutes(minuteTimeout)), null, builder, cacheTags)
 {
 }
Ejemplo n.º 5
0
 public DistributedCacheRegistration(string name, DistributedCacheEntryOptions entryOptions, DistributedCacheItemBuilderAsync builder, params string[] cacheTags)
     : this(new StackTrace(), name, entryOptions, null, builder, cacheTags != null && cacheTags.Length > 0 ? (a, b) => cacheTags : (Func <object, object[], string[]>)null)
 {
 }