I'm using AutoMapper to map POCO's in the usual way. But I have a common scenario where I want to map a class like:
class MyClassSrc
{
public int my_property {get; set;}
}
class MyClassDest
{
public int MyProperty {get; set;}
}
But I think I need more flexibility than what's offered by:
cfg.SourceMemberNamingConvention = new LowerUnderscoreNamingConvention();
cfg.DestinationMemberNamingConvention = new PascalCaseNamingConvention();
because the destination object may or may not cleanly be called MyProperty. For instance, I may generally want that format, but there might be another case where I want it to be Acronym_XYZ or _3D_Game, where I leave in the underscore to be more readable, or because a .net identifier can't start with a number.
I also always want case insensitive mapping.
Will the built in naming conventions simply ignore all underscores, and remain case sensitive, correctly mapping my_property to My_Property, or do I need a custom convention for this? (And if so, how do you build one that compare source and destination property names in this fuzzy sense)?