Share via


IMvcBuilder Interface

Definition

An interface for configuring MVC services.

public interface IMvcBuilder
type IMvcBuilder = interface
Public Interface IMvcBuilder

Properties

Name Description
PartManager

Gets the ApplicationPartManager where ApplicationParts are configured.

Services

Gets the IServiceCollection where MVC services are configured.

Extension Methods

Name Description
AddApplicationPart(IMvcBuilder, Assembly)

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

AddCacheTagHelperLimits(IMvcBuilder, Action<CacheTagHelperOptions>)

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

AddControllersAsServices(IMvcBuilder)

Registers discovered controllers as services in the IServiceCollection.

AddCookieTempDataProvider(IMvcBuilder, Action<CookieTempDataProviderOptions>)

Registers CookieTempDataProvider as the default ITempDataProvider in the IServiceCollection.

AddCookieTempDataProvider(IMvcBuilder)

Registers CookieTempDataProvider as the default ITempDataProvider in the IServiceCollection.

AddDataAnnotationsLocalization(IMvcBuilder, Action<MvcDataAnnotationsLocalizationOptions>)

Adds MVC data annotations localization to the application.

AddDataAnnotationsLocalization(IMvcBuilder)

Adds MVC data annotations localization to the application.

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.

AddJsonOptions(IMvcBuilder, Action<MvcJsonOptions>)
AddMvcLocalization(IMvcBuilder, Action<LocalizationOptions>, 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>)

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

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

AddMvcOptions(IMvcBuilder, Action<MvcOptions>)

Registers an action to configure MvcOptions.

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.

AddRazorOptions(IMvcBuilder, Action<RazorViewEngineOptions>)

Configures a set of RazorViewEngineOptions for the application.

AddRazorPagesOptions(IMvcBuilder, Action<RazorPagesOptions>)

Configures a set of RazorPagesOptions for the application.

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.

AddSessionStateTempDataProvider(IMvcBuilder)

Registers SessionStateTempDataProvider as the default ITempDataProvider in the IServiceCollection.

AddTagHelpersAsServices(IMvcBuilder)

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

AddViewComponentsAsServices(IMvcBuilder)

Registers discovered view components as services in the IServiceCollection.

AddViewLocalization(IMvcBuilder, Action<LocalizationOptions>)

Adds MVC view 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)

Adds MVC view localization services to the application.

AddViewOptions(IMvcBuilder, Action<MvcViewOptions>)

Adds configuration of MvcViewOptions for the application.

AddWebApiConventions(IMvcBuilder)
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.

ConfigureApiBehaviorOptions(IMvcBuilder, Action<ApiBehaviorOptions>)

Configures ApiBehaviorOptions.

ConfigureApplicationPartManager(IMvcBuilder, Action<ApplicationPartManager>)

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

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

Adds an initialization callback for a given TTagHelper.

SetCompatibilityVersion(IMvcBuilder, CompatibilityVersion)
Obsolete.

Sets the CompatibilityVersion for ASP.NET Core MVC 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.

Applies to