Dapper icon indicating copy to clipboard operation
Dapper copied to clipboard

Multi-mapping depends on order of columns

Open mmulhearn opened this issue 3 years ago • 1 comments

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.

mmulhearn avatar Jan 20 '22 15:01 mmulhearn

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.

NickCraver avatar Jan 20 '22 21:01 NickCraver