IViewComponentFactory Interface

Provides methods for creation and disposal of view components.

Namespace
Microsoft.AspNetCore.Mvc.ViewComponents
Assemblies
  • Microsoft.AspNetCore.Mvc.ViewFeatures

Syntax

public interface IViewComponentFactory
interface Microsoft.AspNetCore.Mvc.ViewComponents.IViewComponentFactory

Methods

CreateViewComponent(Microsoft.AspNetCore.Mvc.ViewComponents.ViewComponentContext)

Creates a new controller for the specified <em>context</em>.

Arguments:context (Microsoft.AspNetCore.Mvc.ViewComponents.ViewComponentContext) – Microsoft.AspNetCore.Mvc.ViewComponents.ViewComponentContext for the view component.
Return type:System.Object
Returns:The view component.
object CreateViewComponent(ViewComponentContext context)
ReleaseViewComponent(Microsoft.AspNetCore.Mvc.ViewComponents.ViewComponentContext, System.Object)

Releases a view component instance.

Arguments:
void ReleaseViewComponent(ViewComponentContext context, object component)