Surface plan for Blazor generic type constraints (#17350)

pull/17384/head
Luke Latham 2020-03-20 08:38:52 -05:00 committed by GitHub
parent 84d6b07648
commit ba9016c94d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -5,7 +5,7 @@ description: Learn how templated components can accept one or more UI templates
monikerRange: '>= aspnetcore-3.1'
ms.author: riande
ms.custom: mvc
ms.date: 02/12/2020
ms.date: 03/18/2020
no-loc: [Blazor, SignalR]
uid: blazor/templated-components
---
@ -41,6 +41,9 @@ When using a templated component, the template parameters can be specified using
</TableTemplate>
```
> [!NOTE]
> Generic type constraints will be supported in a future release. For more information, see [Allow generic type constraints (dotnet/aspnetcore #8433)](https://github.com/dotnet/aspnetcore/issues/8433).
## Template context parameters
Component arguments of type `RenderFragment<T>` passed as elements have an implicit parameter named `context` (for example from the preceding code sample, `@context.PetId`), but you can change the parameter name using the `Context` attribute on the child element. In the following example, the `RowTemplate` element's `Context` attribute specifies the `pet` parameter: