Skip to content

2.6.0-preview2

Pre-release
Pre-release
Compare
Choose a tag to compare
@rossgrambo rossgrambo released this 08 Jun 21:57
· 266 commits to main since this release
df31635

Enhancement - Parameter Caching

Applications using built-in ConfigurationFeatureDefinitionProvider will now benefit from caching of feature filter parameters. This will improve performance of the application by reducing the number of times a filter's parameters are cast in short time frames, yielding observed performance increase of up to 100x. This change will not affect custom filters by default. For custom filters, the class must implement the IFilterParametersBinder interface. Below is an example.

class MyFilter : IFeatureFilter, IFilterParametersBinder
{
    public object BindParameters(IConfiguration filterParameters)
    {
        return filterParameters.Get<FilterSettings>();
    }

    public Task<bool> EvaluateAsync(FeatureFilterEvaluationContext context, CancellationToken cancellationToken)
    {
        FilterSettings settings = (FilterSettings)context.Settings;
        ...
    }
}

For more details read here