Dapper
Dapper copied to clipboard
Multi-mapping depends on order of columns
See this stack overflow for details on the issue.
I forked Dapper and created a small console app in the solution that illustrates the issue. Simply update the connection string as necessary (doesn't actually pull from it, just needs a valid connection to run) and then comment/uncomment the SQL statements to show the issue.
I'm trying to follow the problem here - is it a question overall? If so: yes, it depends on order - this is very intentional. If for example you had the same column on 4 different types we couldn't know how to deal with that and it'd be ambiguous. The order of the columns should make the order of your types, and the order of the splitOn
arguments accordingly.