I'm seeing a big picture of a lot of issues solved in a single way here. People want to slightly adjust how the type mapping works in various ways - and I think we can do a better job of allowing this.
Here are some examples:
This one is a more questionable example (as in questionable if this would help):
There may be a few I missed, but you get the idea. You can replace the DefaultTypeMap since #110 was merged a few weeks ago. However, we can do better here by allowing DefaultTypeMap to be plugged a bit rather than clipboard inherited all over. We'd also need to look at what functionality could move down into it to be pluggable (such as column names).
I'm not arguing for this to all be in core - I honestly think it'd be a bad idea if all of it was. I think making it pluggable makes some of the odder cases, if common, appear as mappers you could easily plug in from contrib. For example, what if #376 could be fixed by:
SqlMapper.TypeMapProvider = t => Dapper.Contrib.DataMemberMapper;
and #350 by:
SqlMapper.TypeMapProvider = t => MyCustomMultiMapper;
Posting this here for thoughts.
I'm seeing a big picture of a lot of issues solved in a single way here. People want to slightly adjust how the type mapping works in various ways - and I think we can do a better job of allowing this.
Here are some examples:
[Column]attribute (I'm thinking[DataMember])Query<T>mapperIdcolumns that could possibly be worked aroundTimeSpanmapsThis one is a more questionable example (as in questionable if this would help):
There may be a few I missed, but you get the idea. You can replace the
DefaultTypeMapsince #110 was merged a few weeks ago. However, we can do better here by allowing DefaultTypeMap to be plugged a bit rather than clipboard inherited all over. We'd also need to look at what functionality could move down into it to be pluggable (such as column names).I'm not arguing for this to all be in core - I honestly think it'd be a bad idea if all of it was. I think making it pluggable makes some of the odder cases, if common, appear as mappers you could easily plug in from contrib. For example, what if #376 could be fixed by:
and #350 by:
Posting this here for thoughts.