private Type GetRealControllerType(Type controllerType)
{
Type prev = controllerType;
// try to get the first non-proxy type
while(controllerType.Assembly.FullName.StartsWith("DynamicProxyGenAssembly2") ||
controllerType.Assembly.FullName.StartsWith("DynamicAssemblyProxyGen"))
{
controllerType = controllerType.BaseType;
if (controllerType == typeof(SmartDispatcherController) ||
controllerType == typeof(Controller))
{
// oops, it's a pure-proxy controller. just let it go.
controllerType = prev;
break;
}
}
return controllerType;
}