-
Notifications
You must be signed in to change notification settings - Fork 212
Open
Labels
affected-fewarea-blazorarea-compilerUmbrella for all compiler issuesUmbrella for all compiler issuesbugSomething isn't workingSomething isn't workinginvestigate
Milestone
Description
Describe the bug
If a Blazor Component has multiple Generic Parameters then EventCallbacks cannot be bound without an intermediary class.
To Reproduce
GenericComponent.cs
@typeparam THeader
@typeparam TRow
<h3>GenericComponent</h3>
@code {
[Parameter]
public EventCallback<TRow[]> Callback { get; set; }
[Parameter]
public EventCallback<CustomArgs<TRow>> CallbackWithClass { get; set; }
}
CustomArgs.cs
public class CustomArgs<TValue>
{
public TValue[] Values { get; set; }
}
public class Abc
{
}
public class Def
{
}
TestComponent.cs
<GenericComponent
THeader="Abc"
TRow="Def"
Callback="Callback" <-------------------------- Error
CallbackWithClass="CallbackWithClass"
/>
@code {
public async Task Callback(Def[] value)
{
await Task.CompletedTask;
}
public async Task CallbackWithClass(CustomArgs<Def> args)
{
await Task.CompletedTask;
}
}
Exceptions (if any)
CS1503 Argument 2: cannot convert from 'method group' to 'EventCallback'
Further technical details
- ASP.NET Core version: 5.0.0
- Include the output of
dotnet --info
Version: 5.0.100
Commit: 5044b93829 - Visual Studio Community 2019 v16.8.2
mfluehr and dwerner80
Metadata
Metadata
Assignees
Labels
affected-fewarea-blazorarea-compilerUmbrella for all compiler issuesUmbrella for all compiler issuesbugSomething isn't workingSomething isn't workinginvestigate