I'm trying to pass page as argument in Umbraco . and in a helper I need some properties of the page . like Name , ...
This is my code :
var PageWeAreInheritedFrom = CurrentPage;
@ShowBanner(PageWeAreInheritedFrom);
@helper ShowBanner(dynamic pageWeRIn)
{
if (pageWeRIn.bannerIsInherited)
{
@ShowBanner(pageWeRIn.Parent)
}
else
{
//here I want to have a switch case based on pageWeRIn.Name
//but I cant have it.
}
}
This is the Error .seems the page type is different in the helper method
A switch expression or case label must be a bool, char, string, integral, enum, or corresponding nullable type