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)?
Automatically-mapped Properties are now case sensitive · Issue #950 · AutoMapper/AutoMapper · GitHub.
AutoMapper is used whenever there are many data properties for objects, and we need to map them between the object of source class to the object of destination class, Along with the knowledge of data structure and algorithms, a developer is required to have excellent development skills as well.
AutoMapper will save you writing a LOT of boring mapping code and it will probably spare you from a few nasty bugs as well. The only thing you must be aware of is that the mapping uses convensions and you really want to follow these. As long as you do that, AutoMapper is a great tool!
AutoMapper is a popular object-to-object mapping library that can be used to map objects belonging to dissimilar types. As an example, you might need to map the DTOs (Data Transfer Objects) in your application to the model objects.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With