Esempio n. 1
0
        private static Expression GetTargetValidCheckOrNull(this IMemberMapperData mapperData, Type targetType)
        {
            if (!mapperData.TargetMember.IsReadable || mapperData.TargetIsDefinitelyUnpopulated())
            {
                return(null);
            }

            var targetIsOfDerivedType = mapperData.GetTargetIsDerivedTypeCheck(targetType);

            if (mapperData.TargetIsDefinitelyPopulated())
            {
                return(targetIsOfDerivedType);
            }

            var targetIsNull  = mapperData.TargetObject.GetIsDefaultComparison();
            var targetIsValid = OrElse(targetIsNull, targetIsOfDerivedType);

            return(targetIsValid);
        }