PolicyServiceCollectionExtensions.AddAuthorization 方法

定义

重载

AddAuthorization(IServiceCollection)

将授权策略服务添加到指定的 IServiceCollection

AddAuthorization(IServiceCollection, Action<AuthorizationOptions>)

将授权策略服务添加到指定的 IServiceCollection

AddAuthorization(IServiceCollection)

Source:
PolicyServiceCollectionExtensions.cs

将授权策略服务添加到指定的 IServiceCollection

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAuthorization (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddAuthorization : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddAuthorization (services As IServiceCollection) As IServiceCollection

参数

services
IServiceCollection

要向其中添加服务的 IServiceCollection

返回

IServiceCollection,以便可以链接其他调用。

适用于

AddAuthorization(IServiceCollection, Action<AuthorizationOptions>)

Source:
PolicyServiceCollectionExtensions.cs

将授权策略服务添加到指定的 IServiceCollection

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAuthorization (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.AspNetCore.Authorization.AuthorizationOptions> configure);
static member AddAuthorization : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.AspNetCore.Authorization.AuthorizationOptions> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddAuthorization (services As IServiceCollection, configure As Action(Of AuthorizationOptions)) As IServiceCollection

参数

services
IServiceCollection

要向其中添加服务的 IServiceCollection

configure
Action<AuthorizationOptions>

用于配置提供的 AuthorizationOptions的操作委托。

返回

IServiceCollection,以便可以链接其他调用。

适用于