Update view-components.md (#9781)

* Update view-components.md

* Nits
pull/9788/head
buddhacatmonk 2018-12-04 01:39:27 +01:00 committed by Rick Anderson
parent c451738a99
commit 7220a5cc38
1 changed files with 7 additions and 7 deletions

View File

@ -3,7 +3,7 @@ title: View components in ASP.NET Core
author: rick-anderson
description: Learn how view components are used in ASP.NET Core and how to add them to apps.
ms.author: riande
ms.date: 02/14/2017
ms.date: 12/03/2018
uid: mvc/views/view-components
---
# View components in ASP.NET Core
@ -57,13 +57,13 @@ A view component class:
### View component methods
A view component defines its logic in an `InvokeAsync` method that returns an `IViewComponentResult`. Parameters come directly from invocation of the view component, not from model binding. A view component never directly handles a request. Typically, a view component initializes a model and passes it to a view by calling the `View` method. In summary, view component methods:
A view component defines its logic in an `InvokeAsync` method that returns a `Task<IViewComponentResult>` or in a synchronous `Invoke` method that returns an `IViewComponentResult`. Parameters come directly from invocation of the view component, not from model binding. A view component never directly handles a request. Typically, a view component initializes a model and passes it to a view by calling the `View` method. In summary, view component methods:
* Define an `InvokeAsync` method that returns an `IViewComponentResult`
* Typically initializes a model and passes it to a view by calling the `ViewComponent` `View` method
* Parameters come from the calling method, not HTTP, there's no model binding
* Are not reachable directly as an HTTP endpoint, they're invoked from your code (usually in a view). A view component never handles a request
* Are overloaded on the signature rather than any details from the current HTTP request
* Define an `InvokeAsync` method that returns a `Task<IViewComponentResult>` or a synchronous `Invoke` method that returns an `IViewComponentResult`.
* Typically initializes a model and passes it to a view by calling the `ViewComponent` `View` method.
* Parameters come from the calling method, not HTTP. There's no model binding.
* Are not reachable directly as an HTTP endpoint. They're invoked from your code (usually in a view). A view component never handles a request.
* Are overloaded on the signature rather than any details from the current HTTP request.
### View search path