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>。