Skip to content

Commit

Permalink
Target EF Core 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bricelam committed Nov 8, 2021
1 parent 2d8b4db commit b945a00
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: .NET Core
name: .NET

on:
push:
Expand All @@ -13,13 +13,13 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.100-rc.2.20479.15
- name: Install dependencies
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
run: dotnet test --no-build --verbosity normal
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,20 @@
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>EntityFrameworkCore.ConfigurationManager</RootNamespace>
<AssemblyName>EntityFrameworkCore.ConfigurationManager.Tests</AssemblyName>
<IsPackable>false</IsPackable>
<LangVersion>8.0</LangVersion>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\key.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0-rc.2.20475.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.0-rc.2.20475.6">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.0-rc.2.20475.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.0-rc.2.20475.6" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ public override bool IsDatabaseProvider
public override string LogFragment
=> "using ConfigurationManager ";

public override long GetServiceProviderHashCode()
public override int GetServiceProviderHashCode()
=> 0;

public override void PopulateDebugInfo(IDictionary<string, string> debugInfo)
=> debugInfo["ConfigurationManager"] = "1";

public override bool ShouldUseSameServiceProvider(DbContextOptionsExtensionInfo other)
=> other is ExtensionInfo;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ public static class ConfigurationManagerServiceCollectionExtensions
public static IServiceCollection AddEntityFrameworkConfigurationManager(this IServiceCollection serviceCollection)
{
new EntityFrameworkRelationalServicesBuilder(serviceCollection)
.TryAddProviderSpecificServices(
x => x.TryAddScoped<INamedConnectionStringResolver, ConfigrationManagerConnectionStringResolver>());
.TryAdd<INamedConnectionStringResolver, ConfigrationManagerConnectionStringResolver>();

return serviceCollection;
}
Expand Down
10 changes: 5 additions & 5 deletions EFCore.ConfigurationManager/EFCore.ConfigurationManager.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<AssemblyName>EntityFrameworkCore.ConfigurationManager</AssemblyName>
<RootNamespace>EntityFrameworkCore.ConfigurationManager</RootNamespace>
<Authors>Brice Lambson</Authors>
Expand All @@ -10,19 +10,19 @@
<PackageTags>EFCore;Config</PackageTags>
<RepositoryUrl>https://github.com/efcore/EFCore.ConfigurationManager.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Copyright2020 Brice Lambson. All rights reserved.</Copyright>
<Copyright2021 Brice Lambson. All rights reserved.</Copyright>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\key.snk</AssemblyOriginatorKeyFile>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<LangVersion>8.0</LangVersion>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReleaseNotes>https://github.com/efcore/EFCore.ConfigurationManager/releases</PackageReleaseNotes>
<Version>2.0.0</Version>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="3.1.9" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ The latest stable version is available on [NuGet](https://www.nuget.org/packages
dotnet add package EntityFrameworkCore.ConfigurationManager
```

Compatibility
-------------

The following table shows which version of this library to use with which version of EF Core.

EF Core | Version to use
------- | --------------
6.0 | 2.x
5.0 | 1.x
3.1 | 1.x

Usage
-----

Expand Down

0 comments on commit b945a00

Please sign in to comment.