PageConventionCollectionExtensions.ConfigureFilter Method

Definition

Overloads

ConfigureFilter(PageConventionCollection, IFilterMetadata)

Configures the specified filter to apply to all Razor Pages.

ConfigureFilter(PageConventionCollection, Func<PageApplicationModel,IFilterMetadata>)

Configures the specified factory to apply filters to all Razor Pages.

ConfigureFilter(PageConventionCollection, IFilterMetadata)

Source:
PageConventionCollectionExtensions.cs
Source:
PageConventionCollectionExtensions.cs
Source:
PageConventionCollectionExtensions.cs

Configures the specified filter to apply to all Razor Pages.

C#
public static Microsoft.AspNetCore.Mvc.ApplicationModels.PageConventionCollection ConfigureFilter (this Microsoft.AspNetCore.Mvc.ApplicationModels.PageConventionCollection conventions, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata filter);

Parameters

conventions
PageConventionCollection

The PageConventionCollection to configure.

filter
IFilterMetadata

The IFilterMetadata to add.

Returns

The PageConventionCollection.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

ConfigureFilter(PageConventionCollection, Func<PageApplicationModel,IFilterMetadata>)

Source:
PageConventionCollectionExtensions.cs
Source:
PageConventionCollectionExtensions.cs
Source:
PageConventionCollectionExtensions.cs

Configures the specified factory to apply filters to all Razor Pages.

C#
public static Microsoft.AspNetCore.Mvc.ApplicationModels.IPageApplicationModelConvention ConfigureFilter (this Microsoft.AspNetCore.Mvc.ApplicationModels.PageConventionCollection conventions, Func<Microsoft.AspNetCore.Mvc.ApplicationModels.PageApplicationModel,Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata> factory);

Parameters

conventions
PageConventionCollection

The PageConventionCollection to configure.

factory
Func<PageApplicationModel,IFilterMetadata>

The factory to create filters.

Returns

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0