Skip to content

Commit

Permalink
code fix after update
Browse files Browse the repository at this point in the history
  • Loading branch information
lkurzyniec committed Jan 22, 2023
1 parent 3c2b7dc commit c7a6cfd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/HappyCode.NetCoreBoilerplate.Api/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<EmployeesContext>(options => options.UseMySql(_configuration.GetConnectionString("MySqlDb"), ServerVersion.Parse("8")), contextLifetime: ServiceLifetime.Transient, optionsLifetime: ServiceLifetime.Singleton);
services.AddDbContext<EmployeesContext>(options => options.UseMySql(_configuration.GetConnectionString("MySqlDb"), ServerVersion.Parse("8.0")), contextLifetime: ServiceLifetime.Transient, optionsLifetime: ServiceLifetime.Singleton);
services.AddDbContextPool<CarsContext>(options => options.UseSqlServer(_configuration.GetConnectionString("MsSqlDb")), poolSize: 10);

services.Configure<ApiKeySettings>(_configuration.GetSection("ApiKey"));
Expand Down

0 comments on commit c7a6cfd

Please sign in to comment.