diff --git a/src/Microsoft.FeatureManagement/FeatureFilters/TimeWindowFilter.cs b/src/Microsoft.FeatureManagement/FeatureFilters/TimeWindowFilter.cs index 62b5f4a5..389d129f 100644 --- a/src/Microsoft.FeatureManagement/FeatureFilters/TimeWindowFilter.cs +++ b/src/Microsoft.FeatureManagement/FeatureFilters/TimeWindowFilter.cs @@ -37,9 +37,9 @@ public TimeWindowFilter(ILoggerFactory loggerFactory = null) public IMemoryCache Cache { get; set; } /// - /// This property allows the time window filter in our test suite to use simulated time. + /// This property allows the time window filter to use custom . /// - internal TimeProvider SystemClock { get; set; } + public TimeProvider SystemClock { get; set; } /// /// Binds configuration representing filter parameters to . diff --git a/src/Microsoft.FeatureManagement/ServiceCollectionExtensions.cs b/src/Microsoft.FeatureManagement/ServiceCollectionExtensions.cs index 806c66fa..db43e8c6 100644 --- a/src/Microsoft.FeatureManagement/ServiceCollectionExtensions.cs +++ b/src/Microsoft.FeatureManagement/ServiceCollectionExtensions.cs @@ -175,7 +175,8 @@ private static IFeatureManagementBuilder GetFeatureManagementBuilder(IServiceCol builder.AddFeatureFilter(sp => new TimeWindowFilter() { - Cache = sp.GetRequiredService() + Cache = sp.GetRequiredService(), + SystemClock = sp.GetService() ?? TimeProvider.System, }); builder.AddFeatureFilter();