I do everything in the documentation, but it's not working. Parameter @context is unknown. What do I wrong? Is this an april's fool? documentation is last updated 3/13/2020 so it's unlikely to be an april's fool.
Edit: For those of you who face the same 'problem': Answer: Just ignore it or turn off resharper code analysis. The displayed error will be gone. It compiles anyways.
I am referring to this:
@typeparam TItem
<table class="table">
<thead>
<tr>@TableHeader</tr>
</thead>
<tbody>
@foreach (var item in Items)
{
<tr>@RowTemplate(item)</tr>
}
</tbody>
<tfoot>
<tr>@TableFooter</tr>
</tfoot>
</table>
@code {
[Parameter]
public RenderFragment TableHeader { get; set; }
[Parameter]
public RenderFragment<TItem> RowTemplate { get; set; }
[Parameter]
public RenderFragment TableFooter { get; set; }
[Parameter]
public IReadOnlyList<TItem> Items { get; set; }
}
<TableTemplate Items="pets">
<TableHeader>
<th>ID</th>
<th>Name</th>
</TableHeader>
<RowTemplate>
<td>@context.PetId</td>
<td>@context.Name</td>
</RowTemplate>
</TableTemplate>
variable @context is unknown. what is the problem?