IFeatureCollection Interface

Represents a collection of HTTP features.

Namespace
Microsoft.AspNetCore.Http.Features
Assemblies
  • Microsoft.AspNetCore.Http.Features

Syntax

public interface IFeatureCollection : IEnumerable<KeyValuePair<Type, object>>, IEnumerable
interface Microsoft.AspNetCore.Http.Features.IFeatureCollection

Methods

Get<TFeature>()

Retrieves the requested feature from the collection.

Return type:TFeature
Returns:The requested feature, or null if it is not present.
TFeature Get<TFeature>()
Set<TFeature>(TFeature)

Sets the given feature in the collection.

Arguments:instance (TFeature) – The feature value.
void Set<TFeature>(TFeature instance)

Properties

Microsoft.AspNetCore.Http.Features.IFeatureCollection.IsReadOnly

Indicates if the collection can be modified.

Return type:System.Boolean
bool IsReadOnly { get; }
Microsoft.AspNetCore.Http.Features.IFeatureCollection.Item[System.Type]

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

Return type:System.Object
Returns:The requested feature, or null if it is not present.
object this[Type key] { get; set; }
Microsoft.AspNetCore.Http.Features.IFeatureCollection.Revision

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

Return type:System.Int32
int Revision { get; }