Last active
January 27, 2016 10:57
-
-
Save lbargaoanu/6b6b6f115b4fa51900a5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
Mapper.CreateMap<iclass1, iclass1DTO>(); | |
Mapper.CreateMap<iclass2, iclass2DTO>(); | |
try | |
{ | |
Mapper.AssertConfigurationIsValid(); | |
var bo = new class2 { prop1 = "PROP1", prop2 = "PROP2" }; | |
Mapper.Map(bo, new class2DTO()).Dump(); | |
//typeof(class4).GetInterfaces().Where(i=>typeof(class4).GetInterfaceMap(i).TargetMethods.Any(m=>m.DeclaringType==typeof(class4))).Dump(); | |
} | |
catch(Exception ex) | |
{ | |
ex.ToString().Dump(); | |
} | |
} | |
public class class1 : iclass1 | |
{ | |
public string prop1 { get;set;} | |
} | |
public class class2 : class1, iclass2 | |
{ | |
public string prop2 { get; set; } | |
} | |
public class class1DTO : iclass1DTO | |
{ | |
public string prop1 { get; set; } | |
} | |
public class class2DTO : class1DTO, iclass2DTO | |
{ | |
public string prop2 { get; set; } | |
} | |
public interface iclass1 | |
{ | |
string prop1 { get; set; } | |
} | |
public interface iclass2 | |
{ | |
string prop2 { get; set; } | |
} | |
public interface iclass1DTO | |
{ | |
string prop1 { get; set; } | |
} | |
public interface iclass2DTO | |
{ | |
string prop2 { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment