MvcServiceCollectionExtensions.AddMvc 方法

定义

重载

AddMvc(IServiceCollection)

将 MVC 服务添加到指定的 IServiceCollection

AddMvc(IServiceCollection, Action<MvcOptions>)

将 MVC 服务添加到指定的 IServiceCollection

AddMvc(IServiceCollection)

将 MVC 服务添加到指定的 IServiceCollection

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

参数

services
IServiceCollection

要向其中添加服务的 IServiceCollection

返回

IMvcBuilder

可用于进一 IMvcBuilder 步配置 MVC 服务。

适用于

AddMvc(IServiceCollection, Action<MvcOptions>)

将 MVC 服务添加到指定的 IServiceCollection

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

参数

services
IServiceCollection

要向其中添加服务的 IServiceCollection

setupAction
Action<MvcOptions>

用于配置所提供的 MvcOptionsAction<T>

返回

IMvcBuilder

可用于进一 IMvcBuilder 步配置 MVC 服务。

适用于