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, DistributedCacheItemBuilderAsync builder, Func <object, object[], string[]> cacheTags) : this(new StackTrace(), name, entryOptions, null, builder, cacheTags) { }
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) { }
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) { }
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) { }