我正在嘗試使用 MiniProfiler.Integrations.MySql 和 Dapper.Contrib 擴(kuò)展來(lái)分析發(fā)送到 MySql 服務(wù)器的 sql 查詢。我正在使用我自己的 ConnectionFactory:public IDbConnection GetConnection(){ var connection = (DbConnection) new MySqlConnection(_connectionString); return new ProfiledDbConnection(connection, CustomDbProfiler.Current);}Dapper.Contrib 允許像插入新記錄一樣簡(jiǎn)單public async Task AddAsync(TEntity sample){ using (var connection = _connectionFactory.GetConnection()) { await connection.InsertAsync(sample); }}但ProfiledDbConnection被解釋為SQLConnection, 產(chǎn)生與 MySQL 不兼容的 SQLServer 語(yǔ)法: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[Id], [CreatedAt], [AndSoOn]' at line 1尋求有關(guān)如何解決問題并使 MiniProfiler 工作的建議。我正在使用(全部來(lái)自 Nuget):Dapper:1.50.5Dapper.Contrib:1.50.5 MiniProfiler:3.2.0 MiniProfiler.Integrations.MySql:1.0.1
Dapper.Contrib 和 MiniProfiler(用于 MySql)集成問題
狐的傳說(shuō)
2021-07-02 14:36:08