Exemplo n.º 1
0
        private void CreateNameMapping(MapperConfig config)
        {
            var source = new MappingEntity
            {
                ObjectType   = typeof(SourceObject).AssemblyQualifiedName,
                PropertyName = nameof(SourceObject.PropNo1)
            };
            var target = new MappingEntity
            {
                ObjectType   = typeof(TargetObject).AssemblyQualifiedName,
                PropertyName = nameof(TargetObject.Name)
            };
            var nameMapping = new Mapping(source, target);

            config.Add(nameMapping);
        }
Exemplo n.º 2
0
        private void CreateBirthDateMapping(MapperConfig config)
        {
            var source = new MappingEntity
            {
                ObjectType   = typeof(SourceObject).AssemblyQualifiedName,
                PropertyName = nameof(SourceObject.PropNo2)
            };
            var target = new MappingEntity
            {
                ObjectType   = typeof(TargetObject).AssemblyQualifiedName,
                PropertyName = nameof(TargetObject.BirthDate)
            };
            var nameMapping = new Mapping(source, target)
            {
                ConversionFormat = "yyyyMMdd"
            };

            config.Add(nameMapping);
        }
Exemplo n.º 3
0
        private void CreateCommentMapping(MapperConfig config)
        {
            var source = new MappingEntity
            {
                ObjectType   = typeof(SourceObject).AssemblyQualifiedName,
                PropertyName = nameof(SourceObject.PropNo3)
            };
            var target = new MappingEntity
            {
                ObjectType   = typeof(TargetObject).AssemblyQualifiedName,
                PropertyName = nameof(TargetObject.Comment)
            };
            var nameMapping = new Mapping(source, target)
            {
                ConversionFormat = "Comment:=$VALUE$"
            };

            config.Add(nameMapping);
        }