共用方式為


MvcViewFeaturesMvcBuilderExtensions.AddViewComponentsAsServices 方法

定義

將探索到的檢視元件註冊為 中的 IServiceCollection 服務。

public static Microsoft.Extensions.DependencyInjection.IMvcBuilder AddViewComponentsAsServices (this Microsoft.Extensions.DependencyInjection.IMvcBuilder builder);
static member AddViewComponentsAsServices : Microsoft.Extensions.DependencyInjection.IMvcBuilder -> Microsoft.Extensions.DependencyInjection.IMvcBuilder
<Extension()>
Public Function AddViewComponentsAsServices (builder As IMvcBuilder) As IMvcBuilder

參數

傳回

IMvcBuilder

適用於