I completely migrated a aspnet 5 rc1 project into the aspnet core-rc2 and made sure everything is working the same as before; however, I can't seem to get my ViewComponents to work in rc2 and I'm not exactly sure how to implement it in the "new" way.
Here is how I have it set up right now:
Somewhere in the a .cshtml file i have:
@Component.Invoke("AddActivity", Model.Id)
then I have the viewcomponent in a folder
public class AddActivityViewComponent : ViewComponent
{
public IViewComponentResult Invoke(int id)
{
ActivityViewModel model = new ActivityViewModel();
model.IssueId = id;
return View("ActivityModal", model);
}
}
and with this it would normally return the ActivityModal cshtml in the shared folder however RC2 seems to be asking for a class that implements IViewComponentHelper?
Please let me know if I'm doing something incorrectly or if there's a better way