FeatureCollectionExtensions.GetRequiredFeature 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
GetRequiredFeature(IFeatureCollection, Type) |
從集合擷取要求的功能。 如果功能不存在,則會擲回 InvalidOperationException。 |
GetRequiredFeature<TFeature>(IFeatureCollection) |
從集合擷取要求的功能。 如果功能不存在,則會擲回 InvalidOperationException。 |
GetRequiredFeature(IFeatureCollection, Type)
從集合擷取要求的功能。 如果功能不存在,則會擲回 InvalidOperationException。
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
參數
- featureCollection
- IFeatureCollection
功能集合
- key
- Type
功能索引鍵。
傳回
要求的功能。
適用於
GetRequiredFeature<TFeature>(IFeatureCollection)
從集合擷取要求的功能。 如果功能不存在,則會擲回 InvalidOperationException。
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
類型參數
- TFeature
功能索引鍵。
參數
- featureCollection
- IFeatureCollection
傳回
TFeature
要求的功能。