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
        }
Example #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
        }
 private static object GenerateCloner(Type t, bool asObject)
 {
     return(DeepClonerExprGenerator.GenerateClonerInternal(t, asObject));
 }