我想与mariadb(mysql引擎)一起使用dapper fastcrud(dapper中的DLL FOR CRUD操作),但是 当我想执行代码时,语法为
似乎当fastcrud要创建查询时,它的默认行为是 创建适合sqlserver的查询(例如,使用[]),我想更改此查询 创建查询mysql的行为 类似于sqldialetic
如果有人可以帮助我
我的示例代码:
var TrustedZone = db.Get(new TrustedZone { Id = 1 });
错误:
An unhandled exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll
Additional information: You have an error in your SQL syntax;
check the manual that corresponds to your MariaDB server version
for the right syntax to use near
'[Id],[IP],[Title],[Description] FROM [TrustedZones] WHERE [Id]=1' at line 1
答案 0 :(得分:1)
在程序的开头,按如下所示配置Dapper.FastCRUD:
OrmConfiguration.DefaultDialect = SqlDialect.MySql;