CQRSlite.Infrastructure.PrivateReflectionDynamicObject.WrapObjectIfNeeded C# (CSharp) Method

WrapObjectIfNeeded() static private method

static private WrapObjectIfNeeded ( object o ) : object
o object
return object
        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 };
        }