You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
I will receive an exception from the view component descriptor collection provider that the above class is missing Invoke or InvokeAsync method. I can easily fix the issue by making the class abstract but since there are NonControllerAttribute and NonActionAttribute maybe it will be useful to have NonViewComponentAttribute.
The text was updated successfully, but these errors were encountered:
I believe NonViewComponent as described here might introduce an inconsistency with the behavior for NonController. NonController marks everything in the hierarchy as not a controller. I'm not sure what the convention for view components is, but given that BaseViewComponent is being picked up, I tend to think its not compatible with the controller one. This is just something to factor in.
I think @javiercn is right here, we'd want it to behave the same for a hypothetical NonViewComponentAttribute as it does for NonControllerAttribute, so the solution to your problem is, as you said, mark it abstract like we do here. That said I think it's perfectly reasonable to add a NonViewComponentAttribute seeing as it seems to be the pattern.
Currently if I have the following class in the project:
I will receive an exception from the view component descriptor collection provider that the above class is missing
Invoke
orInvokeAsync
method. I can easily fix the issue by making the class abstract but since there areNonControllerAttribute
andNonActionAttribute
maybe it will be useful to haveNonViewComponentAttribute
.The text was updated successfully, but these errors were encountered: