forked from Sarah/Lieb-Website
changed to Pomelo.EntityFrameworkCore.MySql for release version
This commit is contained in:
parent
f9ad0ee515
commit
8137b1ca6a
5 changed files with 20 additions and 3 deletions
12
Lieb/.config/dotnet-tools.json
Normal file
12
Lieb/.config/dotnet-tools.json
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"dotnet-ef": {
|
||||
"version": "6.0.2",
|
||||
"commands": [
|
||||
"dotnet-ef"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
|
@ -14,6 +14,7 @@
|
|||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.2" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -13,7 +13,7 @@ builder.Services.AddDbContextFactory<LiebContext>(opt =>
|
|||
opt.UseSqlServer(builder.Configuration.GetConnectionString("LiebContext")).EnableSensitiveDataLogging(), ServiceLifetime.Transient);
|
||||
#else
|
||||
builder.Services.AddDbContextFactory<LiebContext>(opt =>
|
||||
opt.UseSqlServer(builder.Configuration.GetConnectionString("LiebContext")), ServiceLifetime.Transient);
|
||||
opt.UseMySql(builder.Configuration.GetConnectionString("LiebContext"), ServerVersion.AutoDetect(builder.Configuration.GetConnectionString("LiebContext"))), ServiceLifetime.Transient);
|
||||
#endif
|
||||
|
||||
builder.Services.AddDatabaseDeveloperPageExceptionFilter();
|
||||
|
|
|
@ -5,5 +5,9 @@
|
|||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"ConnectionStrings": {
|
||||
"LiebContext": "Server=(localdb)\\mssqllocaldb;Database=LiebContext-f9dae0eb-8d5c-495d-ab99-da7951e0638b;Trusted_Connection=True;MultipleActiveResultSets=true"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,6 @@
|
|||
},
|
||||
"AllowedHosts": "*",
|
||||
"ConnectionStrings": {
|
||||
"LiebContext": "Server=(localdb)\\mssqllocaldb;Database=LiebContext-f9dae0eb-8d5c-495d-ab99-da7951e0638b;Trusted_Connection=True;MultipleActiveResultSets=true"
|
||||
"LiebContext": "Server=liebdb;Database=LiebContext;Uid=root;Pwd=my-secret-pw;"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue