Exemple #1
0
        private void UpdateIfExpressionDoesNotExist(Type sourceType, Type destinationType)
        {
            UpdateDictionaryHolder(sourceType, destinationType);
            var properyMappings = _sourceToDestPropMaps[sourceType][destinationType];

            if (properyMappings != null)
            {
                return;
            }

            try
            {
                var keyProperties = _generatePropertyMaps.GeneratePropertyMaps(sourceType, destinationType);
                if (!keyProperties.Any())
                {
                    _sourceToDestPropMaps[sourceType][destinationType] = GenerateEquivilentExpressions.BadValue;
                }
                else
                {
                    _sourceToDestPropMaps[sourceType][destinationType] = new GenerateEquivilentExpressionOnPropertyMaps(keyProperties);
                }
            }
            catch (Exception ex)
            {
                _sourceToDestPropMaps[sourceType][destinationType] = GenerateEquivilentExpressions.BadValue;
            }
        }
        private void UpdateIfExpressionDoesNotExist(Type sourceType, Type destinationType)
        {
            UpdateDictionaryHolder(sourceType, destinationType);
            var properyMappings = _sourceToDestPropMaps[sourceType][destinationType];

            if (properyMappings != null) 
                return;

            try
            {
                var keyProperties = _generatePropertyMaps.GeneratePropertyMaps(sourceType, destinationType);
                if (!keyProperties.Any())
                    _sourceToDestPropMaps[sourceType][destinationType] = GenerateEquivilentExpressions.BadValue;
                else
                    _sourceToDestPropMaps[sourceType][destinationType] = new GenerateEquivilentExpressionOnPropertyMaps(keyProperties);
            }
            catch (Exception ex)
            {
                _sourceToDestPropMaps[sourceType][destinationType] = GenerateEquivilentExpressions.BadValue;
            }
        }