Page 1 of 1

dotConnect seems to fail with Dapper ORM.

Posted: Fri 22 Jul 2016 21:32
by vdemille
Was using Sql Server with Dapper to do basic data crud. After switch to dotConnect and mysql the syntax is failing. I'm executing the following code which used to work:

Code: Select all

using (var MySqlConnection = new MySqlConnection(IndexConnectionString))
{
   RootBucket newBucket = new RootBucket
   {
      Id = name.GetHashCode(),
      Name = name
   };
   MySqlConnection.Open();
   MySqlConnection.Execute("INSERT IndexerRootBucket(Id, Name) VALUES (@Id, @Name);", newBucket);

   return newBucket;
}
It now gives the thrown exception:
Exception thrown: 'Devart.Data.MySql.MySqlException' in Devart.Data.dll
Additional information: Column 'Id' cannot be null

Do I need to do something different to make this work, or is it unsupported in dotConnect?

Re: dotConnect seems to fail with Dapper ORM.

Posted: Tue 26 Jul 2016 14:55
by Shalex
Looks like Dapper expects Id to be generated on the server side, but it is actually not AUTO_INCREMENT.

If this information doesn't help, please send us a small test project with the corresponding DDL script. In case of >2MB attachment, we recommend either using some file exchange server (send us the corresponding link) or uploading a test project to our FTP server (the credentials will be provided by email request).