MvcCorsMvcCoreBuilderExtensions.AddCors 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
AddCors(IMvcCoreBuilder) |
配置为 IMvcCoreBuilder 使用 CORS。 |
AddCors(IMvcCoreBuilder, Action<CorsOptions>) |
配置为 IMvcCoreBuilder 使用 CORS。 |
AddCors(IMvcCoreBuilder)
配置为 IMvcCoreBuilder 使用 CORS。
public static Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder AddCors (this Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder builder);
static member AddCors : Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder -> Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder
<Extension()>
Public Function AddCors (builder As IMvcCoreBuilder) As IMvcCoreBuilder
参数
- builder
- IMvcCoreBuilder
返回
适用于
AddCors(IMvcCoreBuilder, Action<CorsOptions>)
配置为 IMvcCoreBuilder 使用 CORS。
public static Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder AddCors (this Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder builder, Action<Microsoft.AspNetCore.Cors.Infrastructure.CorsOptions> setupAction);
static member AddCors : Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder * Action<Microsoft.AspNetCore.Cors.Infrastructure.CorsOptions> -> Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder
<Extension()>
Public Function AddCors (builder As IMvcCoreBuilder, setupAction As Action(Of CorsOptions)) As IMvcCoreBuilder
参数
- builder
- IMvcCoreBuilder
- setupAction
- Action<CorsOptions>
用于配置所提供的 CorsOptions 的 Action<T>。