Share via


FeatureCollection Class

Definition

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

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

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

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

IEnumerable.GetEnumerator()

Extension Methods

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