public static void Main()
Class1 source = new Class1
Class2 target = Mapper.Map<Class1,Class2>(source);
Console.WriteLine(target.FirstName + ' ' + target.LastName);
public static U Map<T, U>(T data)
var _result = (U)Activator.CreateInstance(typeof(U), new object[] { });
foreach (PropertyInfo propertyInfo in typeof(T).GetProperties())
var _target = typeof(U).GetProperty(propertyInfo.Name);
.GetProperty(propertyInfo.Name,
BindingFlags.IgnoreCase |
propertyInfo.GetValue(data));
public string LastName {get;set;}
public string FirstName {get;set;}
public string LastName {get;set;}
public string FirstName {get;set;}