Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automapper - want case sensitive

From similar questions on here I have read here that AutoMapper used to be case sensitive, but is now case insensitive. I want it case sensitive - can't see any way to change this, and none of the other questions Re this showed how to do it (I did look). Any ideas anyone?

Thanks

like image 334
RBrowning99 Avatar asked Dec 15 '13 21:12

RBrowning99


People also ask

Is AutoMapper case sensitive?

The name should be the same but NOT CASE-SENSITIVE i.e. the name in source object can be “id” and that in the target object can be “ID”.

When should you not use AutoMapper?

If you have to do complex mapping behavior, it might be better to avoid using AutoMapper for that scenario. Reverse mapping can get very complicated very quickly, and unless it's very simple, you can have business logic showing up in mapping configuration.

Does AutoMapper handle null?

The Null substitution allows us to supply an alternate value for a destination member if the source value is null. That means instead of mapping the null value from the source object, it will map from the value we supply.


1 Answers

You can Refer :

DataReaderMapper should create case-insensitive mappings by default

http://automapper.codeplex.com/workitem/6127

you can control this in Mapper.Initialize as the answer AutoMapper: Mapping between a IDataReader and DTO object

another good post with examples on naming convention mappings: http://blog.ac-graphic.net/automapping-c-objects-from-one-naming-convention-to-an-other/

like image 189
Imran Ali Khan Avatar answered Oct 16 '22 10:10

Imran Ali Khan