diff --git a/docker-compose.yml b/docker-compose.yml index f0b64a5e8..3ca2d3f68 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,7 +21,7 @@ services: - ./db/mysql/mysql-employees.sql:/docker-entrypoint-initdb.d/init.sql mssql: - image: mcr.microsoft.com/mssql/server:2017-latest + image: mcr.microsoft.com/mssql/server:2019-latest container_name: mssql command: /bin/bash ./entrypoint.sh ports: diff --git a/src/HappyCode.NetCoreBoilerplate.Api/Startup.cs b/src/HappyCode.NetCoreBoilerplate.Api/Startup.cs index 775fe7d50..258a709de 100644 --- a/src/HappyCode.NetCoreBoilerplate.Api/Startup.cs +++ b/src/HappyCode.NetCoreBoilerplate.Api/Startup.cs @@ -43,7 +43,7 @@ public virtual void ConfigureServices(IServiceCollection services) .AddDataAnnotations(); //there is a difference between AddDbContext() and AddDbContextPool(), more info https://docs.microsoft.com/en-us/ef/core/what-is-new/ef-core-2.0#dbcontext-pooling and https://stackoverflow.com/questions/48443567/adddbcontext-or-adddbcontextpool - services.AddDbContext(options => options.UseMySql(_configuration.GetConnectionString("MySqlDb"), ServerVersion.Parse("8")), contextLifetime: ServiceLifetime.Transient, optionsLifetime: ServiceLifetime.Singleton); + services.AddDbContext(options => options.UseMySql(_configuration.GetConnectionString("MySqlDb"), ServerVersion.Parse("8.0")), contextLifetime: ServiceLifetime.Transient, optionsLifetime: ServiceLifetime.Singleton); services.AddDbContextPool(options => options.UseSqlServer(_configuration.GetConnectionString("MsSqlDb")), poolSize: 10); services.Configure(_configuration.GetSection("ApiKey"));