If object a
has a property named 'Id' and object b
has a property named 'ID', will AutoMapper correctly map the two properties (without doing a .ForMember(...)
call)?
Asked
Active
Viewed 9,804 times
22

Peter Mortensen
- 30,738
- 21
- 105
- 131

Jon Erickson
- 112,242
- 44
- 136
- 174
2 Answers
30
The trunk version is now default case-insensitive, and supports multiple naming conventions (camelCase, lowercase_underscore, etc). Look for this in the next version of AutoMapper, which should drop in a couple of days.

Jimmy Bogard
- 26,045
- 5
- 74
- 69
-
sweet! thanks. I have been using AutoMapper with great success. – Jon Erickson Sep 03 '09 at 06:49
-
Not sure if things have changed since '09, but it seems AutoMapper is no longer case-insensitive by default? – rtf Mar 09 '14 at 23:28
-
Not sure, there's been hundreds of commits since then. Can you open a GitHub issue? – Jimmy Bogard Mar 13 '14 at 13:16
-
2I grabbed it from Nuget on 4/2/2014, and found it to be case-insensitive out-of-the-box. AND - found it to automatically interconvert strings and enums too! – Gordon Slysz Apr 02 '14 at 17:27