net 6 migration

This commit is contained in:
Roland Fieger
2021-10-15 09:14:09 +02:00
parent f8c6316d4e
commit 505487a345
7 changed files with 43 additions and 38 deletions

View File

@@ -14,7 +14,7 @@ namespace Repositories
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseMySql(_connectionString);
optionsBuilder.UseMySql(_connectionString, ServerVersion.AutoDetect(_connectionString));
}
public DbSet<LookupCategory> LookupCategories { get; set; }

View File

@@ -8,6 +8,7 @@ using Repositories.Interfaces;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Configuration;
using System.Configuration;
namespace Repositories
{
@@ -30,7 +31,7 @@ namespace Repositories
}
else
{
string usedDb = configuration.GetSection("GeneralSettings").GetSection("DbToUse").Get<string>();
string usedDb = configuration.GetSection("GeneralSettings").GetSection("DbToUse").Value;
string connectionString = configuration.GetConnectionString(usedDb);
_dbContext._connectionString = connectionString;
}

View File

@@ -33,7 +33,7 @@ namespace Repositories
}
else
{
string usedDb = configuration.GetSection("GeneralSettings").GetSection("DbToUse").Get<string>();
string usedDb = configuration.GetSection("GeneralSettings").GetSection("DbToUse").Value;
string connectionString = configuration.GetConnectionString(usedDb);
_dbContext._connectionString = connectionString;
}

View File

@@ -1,16 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<ProjectReference Include="..\Datamodels\Datamodels.csproj"/>
<ProjectReference Include="..\Datamodels\Datamodels.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0-rc.2.21480.5"/>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0-rc.2.21480.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.0-rc.2.21480.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.0-preview.7"/>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0-rc.2.21480.5"/>
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0-rc.2.21480.5"/>
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0-rc.2.21480.5" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.0-preview.7" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0-rc.2.21480.5" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0-rc.2.21480.5" />
</ItemGroup>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>