-
Notifications
You must be signed in to change notification settings - Fork 2.1k
View component tag helpers don't allow generic parameters #5216
Comments
This should be done before #5207 |
@NTaylorMullen @ajaybhargavb can you describe here what the scenario is? What is a generic parameter in this context? |
Say you have a view component |
Scenario:Having a ReasonWe generate a |
Got it, thanks! |
@NTaylorMullen does |
What exactly is a generic view component? I thought view components by definition need to be concrete, no? How else could you invoke one? |
@dougbu I gave it a shot and it doesn't look like it can support generic ViewComponents, I've filed an issue. That aside however, this issue is more geared towards non generic public class XViewComponent
{
public string Invoke(List<string> values)
{
return string.Join(", ", values);
}
} |
@Eilon I should have said " |
Back to this issue, @NTaylorMullen are you looking to support |
@dougbu Oh I wouldn't expect that to work because that'd expect the ViewComponent invocation system to map parameters provided and then back-map said parameter to the InvokeAsync call. When you try it in practice you get the following: |
Suggestion: When we port TagHelper discovery to use metadata/ |
View components that are invoked with generic parameters will not be translated into view component tag helpers correctly.
#1051
The text was updated successfully, but these errors were encountered: