MvcCoreServiceCollectionExtensions.AddMvcCore MvcCoreServiceCollectionExtensions.AddMvcCore MvcCoreServiceCollectionExtensions.AddMvcCore MvcCoreServiceCollectionExtensions.AddMvcCore Method

Definition

Overloads

AddMvcCore(IServiceCollection) AddMvcCore(IServiceCollection) AddMvcCore(IServiceCollection) AddMvcCore(IServiceCollection)

Adds the minimum essential MVC services to the specified Microsoft.Extensions.DependencyInjection.IServiceCollection. Additional services including MVC's support for authorization, formatters, and validation must be added separately using the IMvcCoreBuilder returned from this method.

AddMvcCore(IServiceCollection, Action<MvcOptions>) AddMvcCore(IServiceCollection, Action<MvcOptions>) AddMvcCore(IServiceCollection, Action<MvcOptions>) AddMvcCore(IServiceCollection, Action<MvcOptions>)

Adds the minimum essential MVC services to the specified Microsoft.Extensions.DependencyInjection.IServiceCollection. Additional services including MVC's support for authorization, formatters, and validation must be added separately using the IMvcCoreBuilder returned from this method.

AddMvcCore(IServiceCollection) AddMvcCore(IServiceCollection) AddMvcCore(IServiceCollection) AddMvcCore(IServiceCollection)

Adds the minimum essential MVC services to the specified Microsoft.Extensions.DependencyInjection.IServiceCollection. Additional services including MVC's support for authorization, formatters, and validation must be added separately using the IMvcCoreBuilder returned from this method.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IMvcCoreBuilder ^ AddMvcCore(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder AddMvcCore (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddMvcCore : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder
<Extension()>
Public Function AddMvcCore (services As IServiceCollection) As IMvcCoreBuilder

Parameters

services
Microsoft.Extensions.DependencyInjection.IServiceCollection Microsoft.Extensions.DependencyInjection.IServiceCollection Microsoft.Extensions.DependencyInjection.IServiceCollection Microsoft.Extensions.DependencyInjection.IServiceCollection

The Microsoft.Extensions.DependencyInjection.IServiceCollection to add services to.

Returns

An IMvcCoreBuilder that can be used to further configure the MVC services.

Remarks

The AddMvcCore(IServiceCollection) approach for configuring MVC is provided for experienced MVC developers who wish to have full control over the set of default services registered. AddMvcCore(IServiceCollection) will register the minimum set of services necessary to route requests and invoke controllers. It is not expected that any application will satisfy its requirements with just a call to AddMvcCore(IServiceCollection). Additional configuration using the IMvcCoreBuilder will be required.

AddMvcCore(IServiceCollection, Action<MvcOptions>) AddMvcCore(IServiceCollection, Action<MvcOptions>) AddMvcCore(IServiceCollection, Action<MvcOptions>) AddMvcCore(IServiceCollection, Action<MvcOptions>)

Adds the minimum essential MVC services to the specified Microsoft.Extensions.DependencyInjection.IServiceCollection. Additional services including MVC's support for authorization, formatters, and validation must be added separately using the IMvcCoreBuilder returned from this method.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IMvcCoreBuilder ^ AddMvcCore(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Action<Microsoft::AspNetCore::Mvc::MvcOptions ^> ^ setupAction);
public static Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder AddMvcCore (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.AspNetCore.Mvc.MvcOptions> setupAction);
static member AddMvcCore : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.AspNetCore.Mvc.MvcOptions> -> Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder
<Extension()>
Public Function AddMvcCore (services As IServiceCollection, setupAction As Action(Of MvcOptions)) As IMvcCoreBuilder

Parameters

services
Microsoft.Extensions.DependencyInjection.IServiceCollection Microsoft.Extensions.DependencyInjection.IServiceCollection Microsoft.Extensions.DependencyInjection.IServiceCollection Microsoft.Extensions.DependencyInjection.IServiceCollection

The Microsoft.Extensions.DependencyInjection.IServiceCollection to add services to.

setupAction
Action<MvcOptions>

An Action<T> to configure the provided MvcOptions.

Returns

An IMvcCoreBuilder that can be used to further configure the MVC services.

Remarks

The AddMvcCore(IServiceCollection) approach for configuring MVC is provided for experienced MVC developers who wish to have full control over the set of default services registered. AddMvcCore(IServiceCollection) will register the minimum set of services necessary to route requests and invoke controllers. It is not expected that any application will satisfy its requirements with just a call to AddMvcCore(IServiceCollection). Additional configuration using the IMvcCoreBuilder will be required.

Applies to