private static object GenerateCloner(Type t, bool asObject)
        {
#if !NETCORE
            if (ShallowObjectCloner.IsSafeVariant())
            {
                return(DeepClonerExprGenerator.GenerateClonerInternal(t, asObject));
            }
            else
            {
                return(DeepClonerMsilGenerator.GenerateClonerInternal(t, asObject));
            }
#else
            return(DeepClonerExprGenerator.GenerateClonerInternal(t, asObject));
#endif
        }
Esempio n. 2
0
        private static object GenerateCloner(Type t, bool asObject)
        {
            if (DeepClonerSafeTypes.CanReturnSameObject(t) && (asObject && !t.IsValueType()))
            {
                return(null);
            }

#if !NETCORE
            if (ShallowObjectCloner.IsSafeVariant())
            {
                return(DeepClonerExprGenerator.GenerateClonerInternal(t, asObject));
            }
            else
            {
                return(DeepClonerMsilGenerator.GenerateClonerInternal(t, asObject));
            }
#else
            return(DeepClonerExprGenerator.GenerateClonerInternal(t, asObject));
#endif
        }