Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to make base view component ASP.NET Core?

In rc1 you can make BaseViewComponent and then inherit it and use it without any problems like baseController, but after migrating my project to rc2 I recieve that error Could: not find an 'Invoke' or 'InvokeAsync' method for the view component 'ForumSystem.Web.ViewComponents.BaseViewComponent'.
Is there any way to do that in rc2?

like image 856
Producenta Avatar asked Jun 04 '16 20:06

Producenta


1 Answers

Having the same problem I red the documentation and found that "view components must be public, non-nested, and non-abstract classes", so I made my base class abstract and this solved my problem. This is a workaround and not a solution for everyone, but worked for me.

like image 121
Rumen Yankov Avatar answered Oct 06 '22 09:10

Rumen Yankov