By default, the RDBMS dialect for dapper extensions is SqlServer. How do I change this to another dialect?
I've figured I can do: (I'm just quickly throwing together a pgsql dialect)
var conf = new DapperExtensionsConfiguration(typeof(AutoClassMapper<>), new List<Assembly>(), new DapperExtensions.Sql.PostgreSqlDialect());
but what do I do with this conf? Do I set it to the connection or to a static method somewhere?
Thanks
The solution is:
DapperExtensions.DapperExtensions.SqlDialect = new PostgreSqlDialect();
Please note that the dialect must be manually set for asynchronous extensions as well:
DapperExtensions.DapperAsyncExtensions.SqlDialect = new PostgreSqlDialect();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With