internal static object WrapObjectIfNeeded(object o)
{
// Don't wrap primitive types, which don't have many interesting internal APIs
if (o == null || o.GetType().GetTypeInfo().IsPrimitive || o is string)
{
return o;
}
return new PrivateReflectionDynamicObject { RealObject = o };
}