MySQL#

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

Note

You can probably use the MySql.EntityFrameworkCore library as well. However, we only test with the Pomelo driver.

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#