Dapper.Contrib
Dapper.Contrib copied to clipboard
Dapper Contrib Insert Update not working
when i update dapper and contrib libs in to latest which is 1.50.4 Insert, Update throws exception. so i downgraded to Dapper in to 1.50.2 and Contrib in to 1.50.0 then works fine.
this is the exception that i'm getting
MySql.Data.MySqlClient.MySqlException (0x80004005): 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 '1s () values ()' at line 1 at MySql.Data.MySqlClient.MySqlStream.ReadPacket() at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId) at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force) at MySql.Data.MySqlClient.MySqlDataReader.NextResult() at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery() at Dapper.SqlMapper.ExecuteImpl(IDbConnection cnn, CommandDefinition& command) in C:\projects\dapper\Dapper\SqlMapper.cs:line 552 at Dapper.SqlMapper.Execute(IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Nullable1 commandTimeout, Nullable1 commandType) in C:\projects\dapper\Dapper\SqlMapper.cs:line 443 at MySqlAdapter.Insert(IDbConnection connection, IDbTransaction transaction, Nullable1 commandTimeout, String tableName, String columnList, String parameterList, IEnumerable1 keyProperties, Object entityToInsert) in C:\projects\dapper\Dapper.Contrib\SqlMapperExtensions.cs:line 897
at Dapper.Contrib.Extensions.SqlMapperExtensions.Insert[T](IDbConnection connection, T entityToInsert, IDbTransaction transaction, Nullable1 commandTimeout) in C:\projects\dapper\Dapper.Contrib\SqlMapperExtensions.cs:line 355 at RecruiterinsiderPortal.Data.AgencyRegionRepository.Save(Int32 userId, List`1 regions) in C:\Empite\RI\RecruiterinsiderPortal\RecruiterinsiderPortal\libs\RecruiterinsiderPortal.Data\AgencyRegionRepository.cs:line 67
thanks
What SQL is generated in the two cases for when it works and does not work?
I am facing the same issue, updating Dapper to Version 1.50.2 updating Dapper.Contrib to Version 1.50.0 resolves the issue.. but don't know whats wrong with the latest package.