/// <summary> /// Uses the in-memory. /// </summary> /// <param name="options">Options.</param> /// <param name="name"></param> /// <param name="setupActions"></param> public static BloomFilterOptions UseInMemory(this BloomFilterOptions options, string name = BloomFilterConstValue.DefaultInMemoryName, Action <FilterMemoryOptions> setupActions = null) { var filterMemoryOptions = new FilterMemoryOptions { Name = name }; setupActions?.Invoke(filterMemoryOptions); options.RegisterExtension(new FilterMemoryOptionsExtension(filterMemoryOptions)); return(options); }
/// <summary> /// Uses the in-memory. /// </summary> /// <param name="options">Options.</param> /// <param name="filterMemoryOptions"></param> public static BloomFilterOptions UseInMemory(this BloomFilterOptions options, FilterMemoryOptions filterMemoryOptions) { if (filterMemoryOptions == null) { throw new ArgumentNullException(nameof(filterMemoryOptions)); } options.RegisterExtension(new FilterMemoryOptionsExtension(filterMemoryOptions)); return(options); }