I could not find an example online where they showed you how to create mappings to multiple databases (in same application) based on which Unit Of Work you are using. Seems like Dapper Extensions will accept only one global SqlDialect.
I want to use Dapper Extensions to map to multiple databases based on which Unit Of Work I am using. So for example for a UoW for repositories User and UserLogin, I want to map them to MySql. For a UoW for repositories Product and Orders, I want to map to Postgres. Both these mappings should work in same application at same time.
I'm not sure how to go about it since the SqlDialect property seems to be a global setting.
The class
DapperExtensionsis astaticclass. Hence all members includingSqlDialectarestatic. That is why the problem you mentioned in question. Even though global, if it was instance class/member, you could have simply created different instance but that is not possible due to the way DapperExtensions is designed.This issue is reported on GitHub here.
Following may be possible solution.
I cannot explain more because I have never used this approach.