I have these two models
public class ModelA
{
public string name { get; set; }
public string email_address { get; set; }
}
public class ModelB
{
public string Name { get; set; }
public string EmailAddress { get; set; }
}
and I have this mapping:
Mapper.Initialize(cfg => cfg.CreateMap<OldStudent, NewStudent>());
var newModel = Mapper.Map<NewStudent>(oldStudent);
Well my mapping wont work because email_address and EmailAddress cannot be mapped.
Now I want to create a logic or to insert code where the email_address will turn to EmailAddress so the mapping will work, (in short I want to remove the underscore and make it CamelCase)
I also have too many properties so I dont want to use the manual mapping (.ForMember method by automapper)
Any idea how can I achieve this? Thanks in advance.