Weird Behaviour of AutoMapper

35 views
Skip to first unread message

thakker...@gmail.com

unread,
Apr 7, 2015, 6:44:44 AM4/7/15
to automapp...@googlegroups.com
Hi ,

I just observed the behavior of AutoMapper to be different than what could be assumed. 
Scenario : 
Suppose there are 2 Classes I am trying to Map : 

Class PersonModel
{
     public String UserName { get; set; }
}

Class PersonEntity
{
     public String user_name{ get; set; } 
}

Which Automapper Succesfully was able to Map automatically. Whereas .Net Framework will allow 2 Different properties having "_" separated names for 2 different Properties into the Same class and will compile Succesfully. 
Suppose:
Class PersonModel
{
     public String UserName { get; set; }

     public String user_name { get; set; }
}




But if this occurs in case of AutoMapper which one would AutoMapper Map ? 
Besides this, is this a Valid behaviour ? This seems non - obvious. 



Jimmy Bogard

unread,
Apr 7, 2015, 8:59:19 AM4/7/15
to automapp...@googlegroups.com
Why would you have those two properties on the destination object?

--
You received this message because you are subscribed to the Google Groups "AutoMapper-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automapper-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages