Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

Automapper ignore prefix per map instead of globally

$
0
0

I want to remove a prefix from my source object, but I'd like to do it for each map an not globally, as it could cause issues where it's removing a column when it shouldn't. Is there an easy way to do this? This is what I'm working with right now

public partial class MappingProfile : Profile
{


    public MappingProfile()
    {
        //I would prefer this not to be a global and only remove the prefix on the specific map below
        RecognizePrefixes("Can");
        CreateMap<Candidate, CandidateVM>();
    }
}


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>