Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

FeatureCollection Class

Definition

Namespace:
Microsoft.AspNetCore.Http.Features
Assembly:
Microsoft.AspNetCore.Http.Features.dll
Assembly:
Microsoft.Extensions.Features.dll
Package:
Microsoft.AspNetCore.Http.Features v1.0.0
Package:
Microsoft.AspNetCore.Http.Features v1.1.0
Package:
Microsoft.Extensions.Features v10.0.0
Package:
Microsoft.Extensions.Features v11.0.0-preview.4.26230.115
Package:
Microsoft.AspNetCore.Http.Features v2.0.0
Package:
Microsoft.AspNetCore.Http.Features v2.1.0
Package:
Microsoft.AspNetCore.Http.Features v2.2.0
Package:
Microsoft.AspNetCore.Http.Features v3.0.3
Package:
Microsoft.AspNetCore.Http.Features v3.1.18
Package:
Microsoft.AspNetCore.Http.Features v5.0.9
Package:
Microsoft.Extensions.Features v6.0.6
Package:
Microsoft.Extensions.Features v7.0.5
Package:
Microsoft.Extensions.Features v8.0.19
Package:
Microsoft.Extensions.Features v9.0.8
Source:
FeatureCollection.cs
Source:
FeatureCollection.cs
Source:
FeatureCollection.cs
Source:
FeatureCollection.cs
Source:
FeatureCollection.cs
Source:
FeatureCollection.cs
Source:
FeatureCollection.cs
Source:
FeatureCollection.cs
Source:
FeatureCollection.cs
Source:
FeatureCollection.cs
Source:
FeatureCollection.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Default implementation for IFeatureCollection.

public ref class FeatureCollection : Microsoft::AspNetCore::Http::Features::IFeatureCollection, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<Type ^, System::Object ^>>
public class FeatureCollection : Microsoft.AspNetCore.Http.Features.IFeatureCollection, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<Type,object>>
type FeatureCollection = class
 interface IFeatureCollection
 interface seq<KeyValuePair<Type, obj>>
 interface IEnumerable
Public Class FeatureCollection
Implements IEnumerable(Of KeyValuePair(Of Type, Object)), IFeatureCollection
Inheritance
FeatureCollection
Implements

Constructors

Name Description
FeatureCollection()

Initializes a new instance of FeatureCollection.

FeatureCollection(IFeatureCollection)

Initializes a new instance of FeatureCollection with the specified defaults.

FeatureCollection(Int32)

Initializes a new instance of FeatureCollection with the specified initial capacity.

Properties

Name Description
IsReadOnly

Indicates if the collection can be modified.

Item[Type]

Gets or sets a given feature. Setting a null value removes the feature.

Revision

Incremented for each modification and can be used to verify cached results.

Methods

Name Description
Get<TFeature>()

Retrieves the requested feature from the collection.

GetEnumerator()

Returns an enumerator that iterates through the collection.

Set<TFeature>(TFeature)

Sets the given feature in the collection.

Explicit Interface Implementations

Name Description
IEnumerable.GetEnumerator()

Extension Methods

Name Description
GetRequiredFeature(IFeatureCollection, Type)

Retrieves the requested feature from the collection. Throws an InvalidOperationException if the feature is not present.

GetRequiredFeature<TFeature>(IFeatureCollection)

Retrieves the requested feature from the collection. Throws an InvalidOperationException if the feature is not present.

Applies to


Feedback

Was this page helpful?