Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is AutoMapper case sensitive or insensitive?

Tags:

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)?

like image 636
Jon Erickson Avatar asked Sep 02 '09 21:09

Jon Erickson


People also ask

Is AutoMapper case sensitive?

Automatically-mapped Properties are now case sensitive · Issue #950 · AutoMapper/AutoMapper · GitHub.

When should I use AutoMapper?

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.

Is AutoMapper worth using?

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!

What is an AutoMapper?

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.


1 Answers

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.

like image 111
Jimmy Bogard Avatar answered Sep 18 '22 05:09

Jimmy Bogard