DataProtectionCommonExtensions.GetDataProtectionProvider 方法

定义

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::DataProtection::IDataProtectionProvider ^ GetDataProtectionProvider(IServiceProvider ^ services);
public static Microsoft.AspNetCore.DataProtection.IDataProtectionProvider GetDataProtectionProvider (this IServiceProvider services);
static member GetDataProtectionProvider : IServiceProvider -> Microsoft.AspNetCore.DataProtection.IDataProtectionProvider
<Extension()>
Public Function GetDataProtectionProvider (services As IServiceProvider) As IDataProtectionProvider

参数

services
IServiceProvider

要从中检索 的 IDataProtectionProvider服务提供商。

返回

IDataProtectionProvider。 此方法保证永远不会返回 null。

例外

如果 中services不存在IDataProtectionProvider任何服务,

适用于