GetServiceForType<TService, TType>(IServiceProvider) Method

Summary

Returns the registered TService whose concrete type is exactly TType.

Syntax

public static TService GetServiceForType<TService, TType>(this IServiceProvider serviceProvider)

Attributes

Type Description
NullableContextAttribute

Type Parameters

Name Description
TService
TType

Parameters

Name Type Description
serviceProvider IServiceProvider

Return Value

Type Description
TService