Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Class FilterCollectionExtensions

Convenient extension methods for Microsoft.AspNetCore.Mvc.Filters.FilterCollection

Inheritance
System.Object
FilterCollectionExtensions
Namespace: EPiServer.DependencyInjection
Assembly: EPiServer.Framework.AspNetCore.dll
Version: 12.0.3
Syntax
public static class FilterCollectionExtensions : Object

Methods

TryAdd<TFilterType>(FilterCollection)

Adds a global filter if it is not already registered

Declaration
public static FilterCollection TryAdd<TFilterType>(this FilterCollection filters)
    where TFilterType : IFilterMetadata
Parameters
Type Name Description
Microsoft.AspNetCore.Mvc.Filters.FilterCollection filters

The filters

Returns
Type Description
Microsoft.AspNetCore.Mvc.Filters.FilterCollection

The filter collection

Type Parameters
Name Description
TFilterType

The filter type to register