diff --git a/src/Microsoft.FeatureManagement/ConfigurationFeatureDefinitionProvider.cs b/src/Microsoft.FeatureManagement/ConfigurationFeatureDefinitionProvider.cs index 3ae10329..ebd1c621 100644 --- a/src/Microsoft.FeatureManagement/ConfigurationFeatureDefinitionProvider.cs +++ b/src/Microsoft.FeatureManagement/ConfigurationFeatureDefinitionProvider.cs @@ -58,12 +58,12 @@ public ConfigurationFeatureDefinitionProvider(IConfiguration configuration) /// /// The option that controls the behavior when "FeatureManagement" section in the configuration is missing. /// - public bool RootConfigurationFallbackEnabled { get; init; } + public bool RootConfigurationFallbackEnabled { get; set; } /// /// The logger for the configuration feature definition provider. /// - public ILogger Logger { get; init; } + public ILogger Logger { get; set; } /// /// Disposes the change subscription of the configuration. diff --git a/src/Microsoft.FeatureManagement/FeatureFilters/TimeWindowFilter.cs b/src/Microsoft.FeatureManagement/FeatureFilters/TimeWindowFilter.cs index 121bb4cf..fb1f6f01 100644 --- a/src/Microsoft.FeatureManagement/FeatureFilters/TimeWindowFilter.cs +++ b/src/Microsoft.FeatureManagement/FeatureFilters/TimeWindowFilter.cs @@ -34,12 +34,12 @@ public TimeWindowFilter(ILoggerFactory loggerFactory = null) /// /// The application memory cache to store the start time of the closest active time window. By caching this time, the time window can minimize redundant computations when evaluating recurrence. /// - public IMemoryCache Cache { get; init; } + public IMemoryCache Cache { get; set; } /// /// This property allows the time window filter in our test suite to use simulated time. /// - internal ISystemClock SystemClock { get; init; } + internal ISystemClock SystemClock { get; set; } /// /// Binds configuration representing filter parameters to . diff --git a/src/Microsoft.FeatureManagement/FeatureManager.cs b/src/Microsoft.FeatureManagement/FeatureManager.cs index ef850a03..9080929d 100644 --- a/src/Microsoft.FeatureManagement/FeatureManager.cs +++ b/src/Microsoft.FeatureManagement/FeatureManager.cs @@ -21,11 +21,11 @@ public sealed class FeatureManager : IFeatureManager private readonly TimeSpan ParametersCacheAbsoluteExpirationRelativeToNow = TimeSpan.FromDays(1); private readonly IFeatureDefinitionProvider _featureDefinitionProvider; - private readonly IEnumerable _featureFilters; - private readonly IEnumerable _sessionManagers; private readonly ConcurrentDictionary _filterMetadataCache; private readonly ConcurrentDictionary _contextualFeatureFilterCache; private readonly FeatureManagementOptions _options; + private IEnumerable _featureFilters; + private IEnumerable _sessionManagers; private class ConfigurationCacheItem { @@ -60,7 +60,7 @@ public IEnumerable FeatureFilters { get => _featureFilters; - init + set { _featureFilters = value ?? throw new ArgumentNullException(nameof(value)); } @@ -74,7 +74,7 @@ public IEnumerable SessionManagers { get => _sessionManagers; - init + set { _sessionManagers = value ?? throw new ArgumentNullException(nameof(value)); } @@ -83,12 +83,12 @@ public IEnumerable SessionManagers /// /// The application memory cache to store feature filter settings. /// - public IMemoryCache Cache { get; init; } + public IMemoryCache Cache { get; set; } /// /// The logger for the feature manager. /// - public ILogger Logger { get; init; } + public ILogger Logger { get; set; } /// /// Checks whether a given feature is enabled. diff --git a/src/Microsoft.FeatureManagement/IsExternalInit.cs b/src/Microsoft.FeatureManagement/IsExternalInit.cs deleted file mode 100644 index 2798741c..00000000 --- a/src/Microsoft.FeatureManagement/IsExternalInit.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -// - -// The init accessor for properties is supported in C# 9.0 and later. -// This class is used to compile .NET frameworks that don't support C# 9.0 or later while still using the init accessor for a property. -// The code referenced for this file can be found here: https://github.com/dotnet/roslyn/issues/45510#issuecomment-725091019 - -#if NETSTANDARD2_0 || NETSTANDARD2_1 - -using System.ComponentModel; - -namespace System.Runtime.CompilerServices -{ - [EditorBrowsable(EditorBrowsableState.Never)] - internal static class IsExternalInit - { - } -} - -#endif diff --git a/src/Microsoft.FeatureManagement/Microsoft.FeatureManagement.csproj b/src/Microsoft.FeatureManagement/Microsoft.FeatureManagement.csproj index 528a3448..ea79919a 100644 --- a/src/Microsoft.FeatureManagement/Microsoft.FeatureManagement.csproj +++ b/src/Microsoft.FeatureManagement/Microsoft.FeatureManagement.csproj @@ -15,7 +15,9 @@ true false ..\..\build\Microsoft.FeatureManagement.snk - 9.0 + + 8.0