I have an enumeration in my project and I\'ve created a custom editor template for this enumeration. So, now any model I have with a property with a type of this enumeration, wi
You can create a helper to use that inside your view, which is explained here
And you can use this piece of code to get the name.
public static class GenericHelper
{
public static String GetPropertyName(Expression> propertyId)
{
var operant = (MemberExpression)((UnaryExpression)propertyId.Body).Operand;
return operant.Member.Name;
}
}
I assume the default helpers do the same, such as HiddenFor, as they also use Expression