MySQL#

MySQL is supported via the Entity Framework Core repository. Add the Pomelo.EntityFrameworkCore.Mysql driver to your project.

Note

As of the v10.0.0 of the Datasync Library, we no longer test MySQL. It should work, but we can not make any guarantees. Open an issue if you find problems.

Set up#

In the OnModelCreating() method of your context, add the following for each entity:

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
  modelBuilder.Entity<Model>().Property(m => m.UpdatedAt)
    .ValueGeneratedOnAddOrUpdate();

  modelBuilder.Entity<Model>().Property(m => m.Version)
    .IsRowVersion();

  base.OnModelCreating(modelBuilder);
}

Support and further information#