MvcServiceCollectionExtensions.AddMvc Method

Definition

Overloads

AddMvc(IServiceCollection)

Adds MVC services to the specified IServiceCollection.

AddMvc(IServiceCollection, Action<MvcOptions>)

Adds MVC services to the specified IServiceCollection.

AddMvc(IServiceCollection)

Adds MVC services to the specified IServiceCollection.

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

Parameters

services
IServiceCollection

The IServiceCollection to add services to.

Returns

IMvcBuilder

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

AddMvc(IServiceCollection, Action<MvcOptions>)

Adds MVC services to the specified IServiceCollection.

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

Parameters

services
IServiceCollection

The IServiceCollection to add services to.

setupAction
Action<MvcOptions>

An Action<T> to configure the provided MvcOptions.

Returns

IMvcBuilder

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

Applies to