GlobalFilterCollection Class

 

Represents a class that contains all the global filters.

Namespace:   System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

Inheritance Hierarchy

System.Object
  System.Web.Mvc.GlobalFilterCollection

Syntax

public sealed class GlobalFilterCollection : IEnumerable<Filter>, 
    IEnumerable, IFilterProvider
public ref class GlobalFilterCollection sealed : IEnumerable<Filter^>, 
    IEnumerable, IFilterProvider
[<Sealed>]
type GlobalFilterCollection = 
    class
        interface IEnumerable<Filter>
        interface IEnumerable
        interface IFilterProvider
    end
Public NotInheritable Class GlobalFilterCollection
    Implements IEnumerable(Of Filter), IEnumerable, IFilterProvider

Constructors

Name Description
System_CAPS_pubmethod GlobalFilterCollection()

Initializes a new instance of the GlobalFilterCollection class.

Properties

Name Description
System_CAPS_pubproperty Count

Gets the number of filters in the global filter collection.

Methods

Name Description
System_CAPS_pubmethod Add(Object)

Adds the specified filter to the global filter collection.

System_CAPS_pubmethod Add(Object, Int32)

Adds the specified filter to the global filter collection using the specified filter run order.

System_CAPS_pubmethod Clear()

Removes all filters from the global filter collection.

System_CAPS_pubmethod Contains(Object)

Determines whether a filter is in the global filter collection.

System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_pubmethod GetEnumerator()

Returns an enumerator that iterates through the global filter collection.

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_pubmethod Remove(Object)

Removes all the filters that match the specified filter.

System_CAPS_pubmethod ToString()

(Inherited from Object.)

Explicit Interface Implementations

Name Description
System_CAPS_pubinterfaceSystem_CAPS_privmethod IEnumerable.GetEnumerator()

This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code.

System_CAPS_pubinterfaceSystem_CAPS_privmethod IFilterProvider.GetFilters(ControllerContext, ActionDescriptor)

This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code.

Extension Methods

Name Description
System_CAPS_pubmethod AsSerializable<Filter>()

Convenience API to allow an IEnumerable{T} (such as returned by Linq2Sql) to be serialized by DataContractSerilizer.(Defined by IEnumerableExtensions.)

Remarks

Global filters run for every action of every controller. You can register a global filter using the Filters static registration endpoint.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

System.Web.Mvc Namespace

Return to top