Dela via


IMvcBuilder Interface

Definition

An interface for configuring MVC services.

public interface IMvcBuilder
type IMvcBuilder = interface
Public Interface IMvcBuilder

Properties

PartManager

Gets the ApplicationPartManager where ApplicationParts are configured.

Services

Gets the IServiceCollection where MVC services are configured.

Extension Methods

AddApplicationPart(IMvcBuilder, Assembly)

Adds an ApplicationPart to the list of ApplicationParts on the PartManager.

AddControllersAsServices(IMvcBuilder)

Registers discovered controllers as services in the IServiceCollection.

AddFormatterMappings(IMvcBuilder, Action<FormatterMappings>)

Configures FormatterMappings for the specified builder.

AddJsonOptions(IMvcBuilder, Action<JsonOptions>)

Configures JsonOptions for the specified builder. Uses default values from JsonSerializerDefaults.Web.

AddMvcOptions(IMvcBuilder, Action<MvcOptions>)

Registers an action to configure MvcOptions.

ConfigureApiBehaviorOptions(IMvcBuilder, Action<ApiBehaviorOptions>)

Configures ApiBehaviorOptions.

ConfigureApplicationPartManager(IMvcBuilder, Action<ApplicationPartManager>)

Configures the ApplicationPartManager of the PartManager using the given Action<T>.

SetCompatibilityVersion(IMvcBuilder, CompatibilityVersion)
Obsolete.

Sets the CompatibilityVersion for ASP.NET Core MVC for the application.

AddDataAnnotationsLocalization(IMvcBuilder, Action<MvcDataAnnotationsLocalizationOptions>)

Adds MVC data annotations localization to the application.

AddDataAnnotationsLocalization(IMvcBuilder)

Adds MVC data annotations localization to the application.

AddJsonOptions(IMvcBuilder, Action<MvcJsonOptions>)
AddMvcLocalization(IMvcBuilder, LanguageViewLocationExpanderFormat, Action<MvcDataAnnotationsLocalizationOptions>)

Adds MVC view and data annotations localization services to the application.

AddMvcLocalization(IMvcBuilder, LanguageViewLocationExpanderFormat)

Adds MVC view and data annotations localization services to the application.

AddMvcLocalization(IMvcBuilder, Action<MvcDataAnnotationsLocalizationOptions>)

Adds MVC view and data annotations localization services to the application.

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

Adds MVC view and data annotations localization services to the application.

AddMvcLocalization(IMvcBuilder, Action<LocalizationOptions>, LanguageViewLocationExpanderFormat)

Adds MVC view and data annotations localization services to the application.

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

Adds MVC view and data annotations localization services to the application.

AddMvcLocalization(IMvcBuilder, Action<LocalizationOptions>)

Adds MVC view and data annotations localization services to the application.

AddMvcLocalization(IMvcBuilder)

Adds MVC view and data annotations localization services to the application.

AddViewLocalization(IMvcBuilder, LanguageViewLocationExpanderFormat, Action<LocalizationOptions>)

Adds MVC view localization services to the application.

AddViewLocalization(IMvcBuilder, LanguageViewLocationExpanderFormat)

Adds MVC view localization services to the application.

AddViewLocalization(IMvcBuilder, Action<LocalizationOptions>)

Adds MVC view localization services to the application.

AddViewLocalization(IMvcBuilder)

Adds MVC view localization services to the application.

AddRazorOptions(IMvcBuilder, Action<RazorViewEngineOptions>)

Configures a set of RazorViewEngineOptions for the application.

AddTagHelpersAsServices(IMvcBuilder)

Registers tag helpers as services and replaces the existing ITagHelperActivator with an Microsoft.AspNetCore.Mvc.Razor.ServiceBasedTagHelperActivator.

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

Adds an initialization callback for a given TTagHelper.

AddRazorPagesOptions(IMvcBuilder, Action<RazorPagesOptions>)

Configures a set of RazorPagesOptions for the application.

WithRazorPagesAtContentRoot(IMvcBuilder)

Configures Razor Pages to be rooted at the content root (ContentRootPath).

WithRazorPagesRoot(IMvcBuilder, String)

Configures Razor Pages to use the specified rootDirectory.

AddCookieTempDataProvider(IMvcBuilder, Action<CookieTempDataProviderOptions>)

Registers CookieTempDataProvider as the default ITempDataProvider in the IServiceCollection.

AddCookieTempDataProvider(IMvcBuilder)

Registers CookieTempDataProvider as the default ITempDataProvider in the IServiceCollection.

AddSessionStateTempDataProvider(IMvcBuilder)

Registers SessionStateTempDataProvider as the default ITempDataProvider in the IServiceCollection.

AddViewComponentsAsServices(IMvcBuilder)

Registers discovered view components as services in the IServiceCollection.

AddViewOptions(IMvcBuilder, Action<MvcViewOptions>)

Adds configuration of MvcViewOptions for the application.

AddXmlDataContractSerializerFormatters(IMvcBuilder, Action<MvcXmlOptions>)

Adds the XML DataContractSerializer formatters to MVC.

AddXmlDataContractSerializerFormatters(IMvcBuilder)

Adds the XML DataContractSerializer formatters to MVC.

AddXmlOptions(IMvcBuilder, Action<MvcXmlOptions>)

Adds configuration of MvcXmlOptions for the application.

AddXmlSerializerFormatters(IMvcBuilder, Action<MvcXmlOptions>)

Adds the XML Serializer formatters to MVC.

AddXmlSerializerFormatters(IMvcBuilder)

Adds the XML Serializer formatters to MVC.

AddNewtonsoftJson(IMvcBuilder, Action<MvcNewtonsoftJsonOptions>)

Configures Newtonsoft.Json specific features such as input and output formatters.

AddNewtonsoftJson(IMvcBuilder)

Configures Newtonsoft.Json specific features such as input and output formatters.

AddRazorRuntimeCompilation(IMvcBuilder, Action<MvcRazorRuntimeCompilationOptions>)

Configures IMvcBuilder to support runtime compilation of Razor views and Razor Pages.

AddRazorRuntimeCompilation(IMvcBuilder)

Configures IMvcBuilder to support runtime compilation of Razor views and Razor Pages.

AddCacheTagHelperLimits(IMvcBuilder, Action<CacheTagHelperOptions>)

Configures the memory size limits on the cache of the CacheTagHelper.

AddWebApiConventions(IMvcBuilder)

Applies to