31
1
using System;
2
using AutoMapper;
3
4
public class Foo
5
{
6
public string Name { get; set; }
7
public int Age { get; set; }
8
}
9
10
public class FooCopy
11
{
12
public string Name { get; set; }
13
public int Age { get; set; }
14
}
15
public class Program
16
{
17
public static void Main()
18
{
19
Mapper.CreateMap<Foo,FooCopy>();
20
21
var foo = new Foo { Name="test", Age=100500 };
22
23
var fooCopy = Mapper.Map<FooCopy>(foo);
24
25
Console.WriteLine("foo type is {0}", foo.GetType());
26
Console.WriteLine("\nfooCopy type is {0}", fooCopy.GetType());
27
28
Console.WriteLine("\nfoo.A={0} foo.B={1}", foo.Name, foo.Age);
29
Console.WriteLine("\nfooCopy.A={0} fooCopy.B={1}", fooCopy.Name, fooCopy.Age);
30
}
31
}
Cached Result
Can you tell me the length of one side
>