MemoryCacheRegistration(StackTrace stackTrace, string name, MemoryCacheEntryOptions entryOptions, MemoryCacheItemBuilder builder, MemoryCacheItemBuilderAsync 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 MemoryCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromMinutes(90)); Builder = builder; BuilderAsync = builderAsync; CacheTags = cacheTags; }
public MemoryCacheRegistration(string name, MemoryCacheEntryOptions entryOptions, MemoryCacheItemBuilderAsync builder, Func <object, object[], string[]> cacheTags) : this(new StackTrace(), name, entryOptions, null, builder, cacheTags) { }
public MemoryCacheRegistration(string name, int minuteTimeout, MemoryCacheItemBuilderAsync builder, params string[] cacheTags) : this(new StackTrace(), name, new MemoryCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromMinutes(minuteTimeout)), null, builder, cacheTags != null && cacheTags.Length > 0 ? (a, b) => cacheTags : (Func <object, object[], string[]>)null) { }
public MemoryCacheRegistration(string name, int minuteTimeout, MemoryCacheItemBuilderAsync builder, Func <object, object[], string[]> cacheTags) : this(new StackTrace(), name, new MemoryCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromMinutes(minuteTimeout)), null, builder, cacheTags) { }
public MemoryCacheRegistration(string name, MemoryCacheEntryOptions entryOptions, MemoryCacheItemBuilderAsync builder, params string[] cacheTags) : this(new StackTrace(), name, entryOptions, null, builder, cacheTags != null && cacheTags.Length > 0 ? (a, b) => cacheTags : (Func <object, object[], string[]>)null) { }