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
请求的功能。