Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ If all of three filters are registered:

## Built-In Feature Filters

There a few feature filters that come with the `Microsoft.FeatureManagement` package: `PercentageFilter`, `TimeWindowFilter`, `ContextualTargetingFilter` and `TargetingFilter`. All filters, except for the `TargetingFilter`, are added automatically when feature management is registered. The `TargetingFilter` is added with the `WithTargeting` method that is detailed in the `Targeting` section below.
There a few feature filters that come with the `Microsoft.FeatureManagement` package: `PercentageFilter`, `TimeWindowFilter`, `ContextualTargetingFilter` and `TargetingFilter`. All filters, except for the `TargetingFilter`, are added **automatically** when feature management is registered by `AddFeatureManagement` method. The `TargetingFilter` is added with the `WithTargeting` method that is detailed in the `Targeting` section below.

Each of the built-in feature filters have their own parameters. Here is the list of feature filters along with examples.

Expand Down Expand Up @@ -603,7 +603,7 @@ The `Recurrence` settings is made up of two parts: `Pattern` (how often the time

#### Recurrence Pattern

There are two possible recurrence pattern types: `Daily` and `Weekly`. For example, a time window could repeat "every day", "every 3 days", "every Monday" or "on Friday per 2 weeks".
There are two possible recurrence pattern types: `Daily` and `Weekly`. For example, a time window could repeat "every day", "every 3 days", "every Monday" or "every other Friday".

Depending on the type, certain fields of the `Pattern` are required, optional, or ignored.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<PropertyGroup>
<MajorVersion>3</MajorVersion>
<MinorVersion>3</MinorVersion>
<PatchVersion>0</PatchVersion>
<PatchVersion>1</PatchVersion>
</PropertyGroup>

<Import Project="..\..\build\Versioning.props" />
Expand All @@ -21,8 +21,10 @@
<Description>Microsoft.FeatureManagement.AspNetCore provides a way to develop and expose application functionality based on features. Many applications have special requirements when a new feature is developed such as when the feature should be enabled and under what conditions. This library provides a way to define these relationships, and also integrates into common ASP.NET Core code patterns to make exposing these features possible.</Description>
<Authors>Microsoft</Authors>
<Company>Microsoft</Company>
<PackageLicenseUrl>https://licenses.nuget.org/MIT</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/Azure/AppConfiguration</PackageProjectUrl>
<PackageProjectUrl>https://github.com/microsoft/FeatureManagement-Dotnet</PackageProjectUrl>
<RepositoryUrl>https://github.com/microsoft/FeatureManagement-Dotnet.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReleaseNotes>Release notes can be found at https://aka.ms/MicrosoftFeatureManagementReleaseNotes</PackageReleaseNotes>
<PackageTags>Microsoft FeatureManagement FeatureFlags AzureAppConfiguration aspnetcore</PackageTags>
<PackageIconUrl>https://aka.ms/AzureAppConfigurationPackageIcon</PackageIconUrl>
Expand Down
8 changes: 8 additions & 0 deletions src/Microsoft.FeatureManagement/FeatureManagementBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.Linq;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.FeatureManagement.FeatureFilters;

namespace Microsoft.FeatureManagement
{
Expand All @@ -26,6 +27,13 @@ public IFeatureManagementBuilder AddFeatureFilter<T>() where T : IFeatureFilterM

Type implementationType = typeof(T);

//
// TimeWindowFilter will only be added through another overload of AddFeatureFilter
if (implementationType == typeof(TimeWindowFilter))
{
return this;
}

IEnumerable<Type> featureFilterImplementations = implementationType.GetInterfaces()
.Where(i => i == typeof(IFeatureFilter) ||
(i.IsGenericType && i.GetGenericTypeDefinition().IsAssignableFrom(typeof(IContextualFeatureFilter<>))));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<PropertyGroup>
<MajorVersion>3</MajorVersion>
<MinorVersion>3</MinorVersion>
<PatchVersion>0</PatchVersion>
<PatchVersion>1</PatchVersion>
</PropertyGroup>

<Import Project="..\..\build\Versioning.props" />
Expand All @@ -22,8 +22,10 @@
<Description>Microsoft.FeatureManagement provides a way to develop and expose application functionality based on features. Many applications have special requirements when a new feature is developed such as when the feature should be enabled and under what conditions. This library provides a way to define these relationships, and also integrates into common .NET code patterns to make exposing these features possible.</Description>
<Authors>Microsoft</Authors>
<Company>Microsoft</Company>
<PackageProjectUrl>https://github.com/Azure/AppConfiguration</PackageProjectUrl>
<PackageLicenseUrl>https://licenses.nuget.org/MIT</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/microsoft/FeatureManagement-Dotnet</PackageProjectUrl>
<RepositoryUrl>https://github.com/microsoft/FeatureManagement-Dotnet.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReleaseNotes>Release notes can be found at https://aka.ms/MicrosoftFeatureManagementReleaseNotes</PackageReleaseNotes>
<PackageTags>Microsoft FeatureManagement FeatureFlags AzureAppConfiguration</PackageTags>
<PackageIconUrl>https://aka.ms/AzureAppConfigurationPackageIcon</PackageIconUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
Expand Down