public async Task MapAsync(MapperTestClass1 source, MapperTestClass2 target, params object[] args)
        {
            target.TheName    = source.Name;
            target.TheAddress = source.Address;

            await Task.Delay(0);
        }
        static public async Task RunAsync()
        {
            var class1 = new MapperTestClass1 {
                Name = "Ross", Address = "123 Main"
            };
            var mapper  = new MyMapper() as IMyMapper;
            var target1 = new MapperTestClass2 {
                TheName = "Ross", TheAddress = "123 Main"
            };

            var class2a = mapper.Map <MapperTestClass1, MapperTestClass2>(class1);

            // async
            var class3a = await mapper.MapAsync <MapperTestClass1, MapperTestClass2>(class1);

            var class3c = await mapper.MapAsync <MapperTestClass1, MapperTestClass2>(class1, target1);
        }
Пример #3
0
        static public Task RunAsync()
        {
            var class1 = new MapperTestClass1 {
                Name = "Ross", Address = "123 Main"
            };

            var mapper  = new MyMapper() as IMyMapper;
            var class2a = mapper.Map(class1);
            var class2b = mapper.Map(class1, (source, target) =>
            {
            });

            var target1 = new MapperTestClass2 {
                TheName = "Ross", TheAddress = "123 Main"
            };

            mapper.Map(class1, target1, (source, target) =>
            {
            });

            return(Task.CompletedTask);
        }
Пример #4
0
 public void Map(MapperTestClass1 source, MapperTestClass2 target)
 {
     target.TheName    = source.Name;
     target.TheAddress = source.Address;
 }
 public void Map(MapperTestClass1 source, MapperTestClass2 target, params object[] args)
 {
     target.TheName    = source.Name;
     target.TheAddress = source.Address;
 }