EncoderServiceCollectionExtensions.AddWebEncoders 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
AddWebEncoders(IServiceCollection) |
将 HtmlEncoder、JavaScriptEncoder 和 UrlEncoder 添加到指定的 |
AddWebEncoders(IServiceCollection, Action<WebEncoderOptions>) |
将 HtmlEncoder、JavaScriptEncoder 和 UrlEncoder 添加到指定的 |
AddWebEncoders(IServiceCollection)
将 HtmlEncoder、JavaScriptEncoder 和 UrlEncoder 添加到指定的 services
中。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddWebEncoders(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddWebEncoders (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddWebEncoders : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddWebEncoders (services As IServiceCollection) As IServiceCollection
参数
- services
- IServiceCollection
返回
IServiceCollection,以便可以链接其他调用。
适用于
AddWebEncoders(IServiceCollection, Action<WebEncoderOptions>)
将 HtmlEncoder、JavaScriptEncoder 和 UrlEncoder 添加到指定的 services
中。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddWebEncoders(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Action<Microsoft::Extensions::WebEncoders::WebEncoderOptions ^> ^ setupAction);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddWebEncoders (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.Extensions.WebEncoders.WebEncoderOptions> setupAction);
static member AddWebEncoders : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.Extensions.WebEncoders.WebEncoderOptions> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddWebEncoders (services As IServiceCollection, setupAction As Action(Of WebEncoderOptions)) As IServiceCollection
参数
- services
- IServiceCollection
- setupAction
- Action<WebEncoderOptions>
用于配置所提供的 WebEncoderOptions 的 Action<T>。
返回
IServiceCollection,以便可以链接其他调用。