ViewComponentHelperExtensions Class¶
Extension methods for Microsoft.AspNetCore.Mvc.IViewComponentHelper.
- Namespace
Microsoft.AspNetCore.Mvc.Rendering- Assemblies
- Microsoft.AspNetCore.Mvc.ViewFeatures
Syntax¶
public class ViewComponentHelperExtensions
-
class
Microsoft.AspNetCore.Mvc.Rendering.ViewComponentHelperExtensions
Methods¶
-
InvokeAsync(Microsoft.AspNetCore.Mvc.IViewComponentHelper, System.String)¶ Invokes a view component with the specified <em>name</em>.
Arguments: - helper (Microsoft.AspNetCore.Mvc.IViewComponentHelper) – The
Microsoft.AspNetCore.Mvc.IViewComponentHelper. - name (System.String) – The name of the view component.
Return type: System.Threading.Tasks.Task<Microsoft.AspNetCore.Html.IHtmlContent>
Returns: A
System.Threading.Tasks.Taskthat on completion returns the renderedMicrosoft.AspNetCore.Html.IHtmlContent.public static Task<IHtmlContent> InvokeAsync(this IViewComponentHelper helper, string name)
- helper (Microsoft.AspNetCore.Mvc.IViewComponentHelper) – The
-
InvokeAsync(Microsoft.AspNetCore.Mvc.IViewComponentHelper, System.Type) Invokes a view component of type <em>componentType</em>.
Arguments: - helper (Microsoft.AspNetCore.Mvc.IViewComponentHelper) – The
Microsoft.AspNetCore.Mvc.IViewComponentHelper. - componentType (System.Type) – The view component
System.Type.
Return type: System.Threading.Tasks.Task<Microsoft.AspNetCore.Html.IHtmlContent>
Returns: A
System.Threading.Tasks.Taskthat on completion returns the renderedMicrosoft.AspNetCore.Html.IHtmlContent.public static Task<IHtmlContent> InvokeAsync(this IViewComponentHelper helper, Type componentType)
- helper (Microsoft.AspNetCore.Mvc.IViewComponentHelper) – The
-
InvokeAsync<TComponent>(Microsoft.AspNetCore.Mvc.IViewComponentHelper)¶ Invokes a view component of type <em>TComponent</em>.
Arguments: helper (Microsoft.AspNetCore.Mvc.IViewComponentHelper) – The Microsoft.AspNetCore.Mvc.IViewComponentHelper.Return type: System.Threading.Tasks.Task<Microsoft.AspNetCore.Html.IHtmlContent> Returns: A System.Threading.Tasks.Taskthat on completion returns the renderedMicrosoft.AspNetCore.Html.IHtmlContent.public static Task<IHtmlContent> InvokeAsync<TComponent>(this IViewComponentHelper helper)
-
InvokeAsync<TComponent>(Microsoft.AspNetCore.Mvc.IViewComponentHelper, System.Object) Invokes a view component of type <em>TComponent</em>.
Arguments: - helper (Microsoft.AspNetCore.Mvc.IViewComponentHelper) – The
Microsoft.AspNetCore.Mvc.IViewComponentHelper. - arguments (System.Object) – Arguments to be passed to the invoked view component method.
Return type: System.Threading.Tasks.Task<Microsoft.AspNetCore.Html.IHtmlContent>
Returns: A
System.Threading.Tasks.Taskthat on completion returns the renderedMicrosoft.AspNetCore.Html.IHtmlContent.public static Task<IHtmlContent> InvokeAsync<TComponent>(this IViewComponentHelper helper, object arguments)
- helper (Microsoft.AspNetCore.Mvc.IViewComponentHelper) – The
-