FeatureCollectionExtensions.GetRequiredFeature Method

Definition

Overloads

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.

GetRequiredFeature(IFeatureCollection, Type)

Source:
FeatureCollectionExtensions.cs
Source:
FeatureCollectionExtensions.cs
Source:
FeatureCollectionExtensions.cs

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

public static object GetRequiredFeature (this Microsoft.AspNetCore.Http.Features.IFeatureCollection featureCollection, Type key);
static member GetRequiredFeature : Microsoft.AspNetCore.Http.Features.IFeatureCollection * Type -> obj
<Extension()>
Public Function GetRequiredFeature (featureCollection As IFeatureCollection, key As Type) As Object

Parameters

featureCollection
IFeatureCollection

feature collection

key
Type

The feature key.

Returns

The requested feature.

Applies to

GetRequiredFeature<TFeature>(IFeatureCollection)

Source:
FeatureCollectionExtensions.cs
Source:
FeatureCollectionExtensions.cs
Source:
FeatureCollectionExtensions.cs

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

public static TFeature GetRequiredFeature<TFeature> (this Microsoft.AspNetCore.Http.Features.IFeatureCollection featureCollection);
static member GetRequiredFeature : Microsoft.AspNetCore.Http.Features.IFeatureCollection -> 'Feature
<Extension()>
Public Function GetRequiredFeature(Of TFeature) (featureCollection As IFeatureCollection) As TFeature

Type Parameters

TFeature

The feature key.

Parameters

featureCollection
IFeatureCollection

The IFeatureCollection.

Returns

TFeature

The requested feature.

Applies to