问题描述
从这里类似的问题中,我已经阅读到AutoMapper
以前是区分大小写的,但是现在不区分大小写.我希望它区分大小写-看不到任何更改此方法的方法,其他所有问题都没有说明如何做到(我确实看过).有任何想法吗?
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?
谢谢
推荐答案
您可以参考:
DataReaderMapper默认情况下应创建不区分大小写的映射
DataReaderMapper should create case-insensitive mappings by default
http://automapper.codeplex.com/workitem/6127
您可以在Mapper中控制它.初始化为答案 AutoMapper:IDataReader和DTO对象之间的映射
you can control this in Mapper.Initialize as the answerAutoMapper: Mapping between a IDataReader and DTO object
另一篇不错的文章,其中包含有关命名约定映射的示例: http://blog.ac-graphic.net/automapping-c-objects-from-one-naming-convention-to-an-other/
another good post with examples on naming convention mappings: http://blog.ac-graphic.net/automapping-c-objects-from-one-naming-convention-to-an-other/
这篇关于Automapper-区分大小写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!