In my project I'm using a custom SqlMapper to map my Db columns in dapper, but when I setup Dapper to user my custom type mapper by doing:
Dapper.SqlMapper.SetTypeMap(typeof(User), new UserMapper());
DapperExtension is no more able to Map my User class so that when I do:
User item = cn.Get<User>(id);
The item contains only default values.
My UserMapper does not interfere with ClassMapper implementation from DapperExtensions and it only implements SqlMapper.ITypeMap
Do you think it overwrites, in any manner, the DapperExtensions functionality? Thank you for your help
After further investigation, I was finally able to find and solve the problem: Say I have a TestClass with property Id mapped in my UserMapper to the database column UserId.
Solved by checking if the search for a IPropertyMap with ColumnName = Id fails; if so, I fallback by searching for an IPropertyMap with Name = Id.
If you think this can be solved in a better way, please let me know Thanks!