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

ApplicationPartManager使用指定的 Action<T> 設定 的 PartManager

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

註冊設定 MvcDataAnnotationsLocalizationOptions MVC 資料批註當地語系化的動作。

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 頁面所需的服務。

AddRazorPages(IMvcCoreBuilder, Action<RazorPagesOptions>)

註冊 Razor 頁面所需的服務。

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 的記憶體大小限制。

適用於