ServiceProviderServiceExtensions.GetService<T>(IServiceProvider) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Get service of type T
from the IServiceProvider.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static T GetService(IServiceProvider ^ provider);
public static T? GetService<T> (this IServiceProvider provider);
static member GetService : IServiceProvider -> 'T
<Extension()>
Public Function GetService(Of T) (provider As IServiceProvider) As T
Type Parameters
- T
The type of service object to get.
Parameters
- provider
- IServiceProvider
The IServiceProvider to retrieve the service object from.
Returns
T
A service object of type T
or null if there is no such service.
Applies to
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
.NET