コード例 #1
0
        internal override IEnumerable <PropertyMapInfo> GetPropertyMapInfo(PropertyInfo targetProperty, Type sourceType)
        {
            var destinationPropertyInfo = TargetType.FindProperties(PropertyName);

            yield return(new PropertyMapInfo
            {
                IgnoreMapping = true,
                TargetType = TargetType,
                SourceType = targetProperty.DeclaringType,
                TargetPropertyInfo = destinationPropertyInfo.First()
            });

            if (AdditionalProperties != null)
            {
                foreach (var prop in AdditionalProperties)
                {
                    var targetPropertyInfo = TargetType.FindProperties(prop);
                    yield return(new PropertyMapInfo
                    {
                        IgnoreMapping = true,
                        TargetType = TargetType,
                        SourceType = targetProperty.DeclaringType,
                        TargetPropertyInfo = targetPropertyInfo.First()
                    });
                }
            }
        }
コード例 #2
0
        internal override IEnumerable <PropertyMapInfo> GetPropertyMapInfo(PropertyInfo targetProperty, Type sourceType = null)
        {
            var targetPropertyInfo = TargetType.FindProperties(PropertyName);

            yield return(new PropertyMapInfo
            {
                TargetType = TargetType,
                TargetPropertyInfo = targetPropertyInfo.First(),
                SourceType = targetProperty.DeclaringType,
                SourcePropertyInfos = new [] { targetProperty }
            });
        }
コード例 #3
0
        internal override PropertyMapInfo GetPropertyMapInfo(PropertyInfo targetProperty)
        {
            var destinationPropertyInfo = TargetType.FindProperties(PropertyName);

            return(new PropertyMapInfo
            {
                TargetType = TargetType,
                TargetPropertyInfo = destinationPropertyInfo.First(),
                SourceType = targetProperty.DeclaringType,
                SourcePropertyInfos = new [] { targetProperty }
            });
        }