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;
        }
 public DistributedCacheRegistration(string name, DistributedCacheEntryOptions entryOptions, DistributedCacheItemBuilder builder, Func <object, object[], string[]> cacheTags)
     : this(new StackTrace(), name, entryOptions, builder, null, cacheTags)
 {
 }
 public DistributedCacheRegistration(string name, int minuteTimeout, DistributedCacheItemBuilder builder, params string[] cacheTags)
     : this(new StackTrace(), name, new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromMinutes(minuteTimeout)), builder, null, cacheTags != null && cacheTags.Length > 0 ? (a, b) => cacheTags : (Func <object, object[], string[]>)null)
 {
 }
 public DistributedCacheRegistration(string name, int minuteTimeout, DistributedCacheItemBuilder builder, Func <object, object[], string[]> cacheTags)
     : this(new StackTrace(), name, new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromMinutes(minuteTimeout)), builder, null, cacheTags)
 {
 }
 public DistributedCacheRegistration(string name, DistributedCacheEntryOptions entryOptions, DistributedCacheItemBuilder builder, params string[] cacheTags)
     : this(new StackTrace(), name, entryOptions, builder, null, cacheTags != null && cacheTags.Length > 0 ? (a, b) => cacheTags : (Func <object, object[], string[]>)null)
 {
 }