IMvcCoreBuilder 接口

定义

用于配置基本 MVC 服务的接口。

public interface IMvcCoreBuilder
type IMvcCoreBuilder = interface
Public Interface IMvcCoreBuilder

属性

PartManager

获取 ApplicationPartManager 配置 的位置 ApplicationPart

Services

获取 IServiceCollection 配置基本 MVC 服务的 。

扩展方法

AddApiExplorer(IMvcCoreBuilder)

IMvcCoreBuilder 配置为使用 ApiExplorer。

AddApplicationPart(IMvcCoreBuilder, Assembly)

ApplicationPart将 添加到 上的 PartManager列表ApplicationParts

AddAuthorization(IMvcCoreBuilder)

builder配置身份验证和授权服务。

AddAuthorization(IMvcCoreBuilder, Action<AuthorizationOptions>)

builder配置身份验证和授权服务。

AddControllersAsServices(IMvcCoreBuilder)

将发现的控制器注册为 中的 IServiceCollection服务。

AddFormatterMappings(IMvcCoreBuilder)

添加服务以支持 FormatterMappings

AddFormatterMappings(IMvcCoreBuilder, Action<FormatterMappings>)

FormatterMappings为指定的 setupAction进行配置。

AddJsonOptions(IMvcCoreBuilder, Action<JsonOptions>)

JsonOptions为指定的 builder进行配置。

AddMvcOptions(IMvcCoreBuilder, Action<MvcOptions>)

注册操作以配置 MvcOptions

ConfigureApiBehaviorOptions(IMvcCoreBuilder, Action<ApiBehaviorOptions>)

配置 ApiBehaviorOptions

ConfigureApplicationPartManager(IMvcCoreBuilder, Action<ApplicationPartManager>)

ApplicationPartManagerPartManager使用给定 Action<T>的 配置 的 。

SetCompatibilityVersion(IMvcCoreBuilder, CompatibilityVersion)
已过时.

CompatibilityVersion为应用程序设置 ASP.NET Core MVC。

AddCors(IMvcCoreBuilder)

配置为 IMvcCoreBuilder 使用 CORS。

AddCors(IMvcCoreBuilder, Action<CorsOptions>)

配置为 IMvcCoreBuilder 使用 CORS。

ConfigureCors(IMvcCoreBuilder, Action<CorsOptions>)

配置 CorsOptions

AddDataAnnotations(IMvcCoreBuilder)

注册 MVC 数据注释。

AddDataAnnotationsLocalization(IMvcCoreBuilder)

将 MVC 数据注释本地化添加到应用程序。

AddDataAnnotationsLocalization(IMvcCoreBuilder, Action<MvcDataAnnotationsLocalizationOptions>)

注册要为 MVC 数据注释本地化配置的 MvcDataAnnotationsLocalizationOptions 操作。

AddJsonFormatters(IMvcCoreBuilder)

用于配置基本 MVC 服务的接口。

AddJsonFormatters(IMvcCoreBuilder, Action<JsonSerializerSettings>)

用于配置基本 MVC 服务的接口。

AddJsonOptions(IMvcCoreBuilder, Action<MvcJsonOptions>)

用于配置基本 MVC 服务的接口。

AddMvcLocalization(IMvcCoreBuilder)

将 MVC 视图和数据注释本地化服务添加到应用程序。

AddMvcLocalization(IMvcCoreBuilder, LanguageViewLocationExpanderFormat)

将 MVC 视图和数据注释本地化服务添加到应用程序。

AddMvcLocalization(IMvcCoreBuilder, LanguageViewLocationExpanderFormat, Action<MvcDataAnnotationsLocalizationOptions>)

将 MVC 视图和数据注释本地化服务添加到应用程序。

AddMvcLocalization(IMvcCoreBuilder, Action<MvcDataAnnotationsLocalizationOptions>)

将 MVC 视图和数据注释本地化服务添加到应用程序。

AddMvcLocalization(IMvcCoreBuilder, Action<LocalizationOptions>)

将 MVC 视图和数据注释本地化服务添加到应用程序。

AddMvcLocalization(IMvcCoreBuilder, Action<LocalizationOptions>, LanguageViewLocationExpanderFormat)

将 MVC 视图和数据注释本地化服务添加到应用程序。

AddMvcLocalization(IMvcCoreBuilder, Action<LocalizationOptions>, LanguageViewLocationExpanderFormat, Action<MvcDataAnnotationsLocalizationOptions>)

将 MVC 视图和数据注释本地化服务添加到应用程序。

AddMvcLocalization(IMvcCoreBuilder, Action<LocalizationOptions>, Action<MvcDataAnnotationsLocalizationOptions>)

将 MVC 视图和数据注释本地化服务添加到应用程序。

AddViewLocalization(IMvcCoreBuilder)

将 MVC 视图本地化服务添加到应用程序。

AddViewLocalization(IMvcCoreBuilder, LanguageViewLocationExpanderFormat)

将 MVC 视图本地化服务添加到应用程序。

AddViewLocalization(IMvcCoreBuilder, LanguageViewLocationExpanderFormat, Action<LocalizationOptions>)

将 MVC 视图本地化服务添加到应用程序。

AddViewLocalization(IMvcCoreBuilder, Action<LocalizationOptions>)

将 MVC 视图本地化服务添加到应用程序。

AddRazorViewEngine(IMvcCoreBuilder)

注册 Razor 视图引擎服务。

AddRazorViewEngine(IMvcCoreBuilder, Action<RazorViewEngineOptions>)

注册 Razor 视图引擎服务。

AddTagHelpersAsServices(IMvcCoreBuilder)

将发现的标记帮助程序注册为服务,并更改 的现有 ITagHelperActivatorMicrosoft.AspNetCore.Mvc.Razor.ServiceBasedTagHelperActivator

InitializeTagHelper<TTagHelper>(IMvcCoreBuilder, Action<TTagHelper,ViewContext>)

为给定 TTagHelper添加初始化回调。

AddRazorPages(IMvcCoreBuilder)

注册 Razor Pages 所需的服务。

AddRazorPages(IMvcCoreBuilder, Action<RazorPagesOptions>)

注册 Razor Pages 所需的服务。

WithRazorPagesRoot(IMvcCoreBuilder, String)

将 Razor Pages 配置为使用指定的 rootDirectory

AddCookieTempDataProvider(IMvcCoreBuilder)

CookieTempDataProvider 注册为 中的IServiceCollection默认值ITempDataProvider。 还注册默认视图服务。

AddCookieTempDataProvider(IMvcCoreBuilder, Action<CookieTempDataProviderOptions>)

CookieTempDataProvider 注册为 中的IServiceCollection默认值ITempDataProvider。 还注册默认视图服务。

AddViews(IMvcCoreBuilder)

添加视图相关服务。

AddViews(IMvcCoreBuilder, Action<MvcViewOptions>)

添加视图相关服务。

ConfigureViews(IMvcCoreBuilder, Action<MvcViewOptions>)

配置 MvcViewOptions

AddXmlDataContractSerializerFormatters(IMvcCoreBuilder)

将 XML DataContractSerializer 格式化程序添加到 MVC。

AddXmlDataContractSerializerFormatters(IMvcCoreBuilder, Action<MvcXmlOptions>)

将 XML DataContractSerializer 格式化程序添加到 MVC。

AddXmlOptions(IMvcCoreBuilder, Action<MvcXmlOptions>)

为应用程序添加 的配置 MvcXmlOptions

AddXmlSerializerFormatters(IMvcCoreBuilder)

将 XML 序列化程序格式化程序添加到 MVC。

AddXmlSerializerFormatters(IMvcCoreBuilder, Action<MvcXmlOptions>)

将 XML 序列化程序格式化程序添加到 MVC。

AddNewtonsoftJson(IMvcCoreBuilder)

配置 Newtonsoft.Json 特定功能,例如输入和输出格式化程序。

AddNewtonsoftJson(IMvcCoreBuilder, Action<MvcNewtonsoftJsonOptions>)

配置 Newtonsoft.Json 特定功能,例如输入和输出格式化程序。

AddRazorRuntimeCompilation(IMvcCoreBuilder)

IMvcCoreBuilder配置为支持 Razor 视图和 Razor 页面的运行时编译。

AddRazorRuntimeCompilation(IMvcCoreBuilder, Action<MvcRazorRuntimeCompilationOptions>)

IMvcCoreBuilder配置为支持 Razor 视图和 Razor 页面的运行时编译。

AddCacheTagHelper(IMvcCoreBuilder)

将 MVC 缓存标记帮助程序服务添加到应用程序。

AddCacheTagHelperLimits(IMvcCoreBuilder, Action<CacheTagHelperOptions>)

对 的缓存 CacheTagHelper配置内存大小限制。

适用于