Skip to content

Commit

Permalink
[WIP] Update to .NET 8
Browse files Browse the repository at this point in the history
It has much better scaffolding capabilities for SQLite since dotnet/efcore#30816

TODO: Wait for Oracle, see oracle/dotnet-db-samples#328
  • Loading branch information
0xced committed Nov 27, 2023
1 parent a1b2c01 commit 8a23718
Show file tree
Hide file tree
Showing 27 changed files with 326 additions and 296 deletions.
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/global",
"sdk": {
"version": "7.0.400",
"version": "8.0.100",
"allowPrerelease": false,
"rollForward": "latestFeature"
}
Expand Down
19 changes: 9 additions & 10 deletions src/EFCore.Scaffolding.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<PropertyGroup Label="Compiling">
Expand Down Expand Up @@ -65,17 +65,16 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="EntityFrameworkCore.Jet" Version="7.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.13" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.13" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.13" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" />
<PackageReference Include="EntityFrameworkCore.Jet" Version="8.0.0-alpha.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
<PackageReference Include="MinVer" Version="4.3.0" PrivateAssets="all" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.11" />
<PackageReference Include="Oracle.EntityFrameworkCore" Version="7.21.12" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.0" />
<!-- <PackageReference Include="Oracle.EntityFrameworkCore" Version="7.21.12" />-->
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" />
<PackageReference Include="System.Data.Odbc" Version="7.0.0" />
<PackageReference Include="System.Data.OleDb" Version="7.0.0" />
<PackageReference Include="System.Data.Odbc" Version="8.0.0" />
<PackageReference Include="System.Data.OleDb" Version="8.0.0" />
</ItemGroup>

<Target Name="ValidateNuGetPackage" AfterTargets="Pack">
Expand Down
6 changes: 3 additions & 3 deletions src/Scaffolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
using Microsoft.Extensions.DependencyInjection;
using MySqlConnector;
using Npgsql;
using Oracle.ManagedDataAccess.Client;
//using Oracle.ManagedDataAccess.Client;

namespace EFCore.Scaffolding;

Expand Down Expand Up @@ -127,7 +127,7 @@ private static DbContext CreateDbContext(DbConnectionStringBuilder connectionStr
JetConnectionStringBuilder jet => isWindows ? builder.UseJet(".", jet.ProviderType) : builder,
MySqlConnectionStringBuilder => builder.UseMySql(MySqlServerVersion.LatestSupportedServerVersion),
NpgsqlConnectionStringBuilder => builder.UseNpgsql(),
OracleConnectionStringBuilder => builder.UseOracle(),
//OracleConnectionStringBuilder => builder.UseOracle(),
SqliteConnectionStringBuilder => builder.UseSqlite(),
SqlConnectionStringBuilder => builder.UseSqlServer(),
_ => builder,
Expand All @@ -140,7 +140,7 @@ private static DbContext CreateDbContext(DbConnectionStringBuilder connectionStr
jetConnectionStringBuilder +
$"{nameof(MySqlConnectionStringBuilder)}, " +
$"{nameof(NpgsqlConnectionStringBuilder)}, " +
$"{nameof(OracleConnectionStringBuilder)}, " +
//$"{nameof(OracleConnectionStringBuilder)}, " +
$"{nameof(SqliteConnectionStringBuilder)} and {nameof(SqlConnectionStringBuilder)}.");
}
return new DbContext(optionsBuilder.Options);
Expand Down
Loading

0 comments on commit 8a23718

Please sign in to comment.