Skip to content

Commit

Permalink
Update to .net 6.0 (#4)
Browse files Browse the repository at this point in the history
Co-authored-by: Henk Kin <[email protected]>
  • Loading branch information
HenkKin and Henk Kin authored Nov 16, 2021
1 parent 74a8f04 commit f500bee
Show file tree
Hide file tree
Showing 26 changed files with 171 additions and 108 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void ModelBuilder_IsCreatable_WhenCalled_ItShouldSetIdentifiableConfigura
public void EntityTypeBuilder_IsCreatable_WhenNotCalled_ItShouldHaveNoConfiguration()
{
// Arrange
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), ConfigurationSource.Explicit);
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), false, ConfigurationSource.Explicit);

// Act
var result = new EntityTypeBuilder<TestEntity>(entityType);
Expand All @@ -61,7 +61,7 @@ public void EntityTypeBuilder_IsCreatable_WhenNotCalled_ItShouldHaveNoConfigurat
public void EntityTypeBuilder_IsCreatable_WhenCalled_ItShouldSetIdentifiableConfiguration()
{
// Arrange
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), ConfigurationSource.Explicit);
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), false, ConfigurationSource.Explicit);
var entityTypeBuilder = new EntityTypeBuilder<TestEntity>(entityType);

// Act
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void ModelBuilder_IsIdentifiable_WhenCalled_ItShouldSetIdentifiableConfig
public void EntityTypeBuilder_IsIdentifiable_WhenNotCalled_ItShouldHaveNoConfiguration()
{
// Arrange
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), ConfigurationSource.Explicit);
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), false, ConfigurationSource.Explicit);

// Act
var result = new EntityTypeBuilder<TestEntity>(entityType);
Expand All @@ -56,7 +56,7 @@ public void EntityTypeBuilder_IsIdentifiable_WhenNotCalled_ItShouldHaveNoConfigu
public void EntityTypeBuilder_IsIdentifiable_WhenCalled_ItShouldSetIdentifiableConfiguration()
{
// Arrange
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), ConfigurationSource.Explicit);
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), false, ConfigurationSource.Explicit);
var entityTypeBuilder = new EntityTypeBuilder<TestEntity>(entityType);

// Act
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void ModelBuilder_IsLocalizable_WhenCalled_ItShouldSetLocalizableConfigur
public void EntityTypeBuilder_IsLocalizable_WhenNotCalled_ItShouldHaveNoConfiguration()
{
// Arrange
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), ConfigurationSource.Explicit);
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), false, ConfigurationSource.Explicit);

// Act
var result = new EntityTypeBuilder<TestEntityView>(entityType);
Expand All @@ -62,7 +62,7 @@ public void EntityTypeBuilder_IsLocalizable_WhenNotCalled_ItShouldHaveNoConfigur
public void EntityTypeBuilder_IsLocalizable_WhenCalled_ItShouldSetLocalizableConfiguration()
{
// Arrange
var entityType = new EntityType(typeof(TestEntityView), new Model(new ConventionSet()), ConfigurationSource.Explicit);
var entityType = new EntityType(typeof(TestEntityView), new Model(new ConventionSet()), false, ConfigurationSource.Explicit);
var entityTypeBuilder = new EntityTypeBuilder<TestEntityView>(entityType);

// Act
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void ModelBuilder_IsModifiable_WhenCalled_ItShouldSetModifiableConfigurat
public void EntityTypeBuilder_IsModifiable_WhenNotCalled_ItShouldHaveNoConfiguration()
{
// Arrange
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), ConfigurationSource.Explicit);
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), false, ConfigurationSource.Explicit);

// Act
var result = new EntityTypeBuilder<TestEntity>(entityType);
Expand All @@ -61,7 +61,7 @@ public void EntityTypeBuilder_IsModifiable_WhenNotCalled_ItShouldHaveNoConfigura
public void EntityTypeBuilder_IsModifiable_WhenCalled_ItShouldSetModifiableConfiguration()
{
// Arrange
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), ConfigurationSource.Explicit);
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), false, ConfigurationSource.Explicit);
var entityTypeBuilder = new EntityTypeBuilder<TestEntity>(entityType);

// Act
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void ModelBuilder_IsRowVersionable_WhenCalled_ItShouldSetIdentifiableConf
public void EntityTypeBuilder_IsRowVersionable_WhenNotCalled_ItShouldHaveNoConfiguration()
{
// Arrange
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), ConfigurationSource.Explicit);
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), false, ConfigurationSource.Explicit);

// Act
var result = new EntityTypeBuilder<TestEntity>(entityType);
Expand All @@ -56,7 +56,7 @@ public void EntityTypeBuilder_IsRowVersionable_WhenNotCalled_ItShouldHaveNoConfi
public void EntityTypeBuilder_IsRowVersionable_WhenCalled_ItShouldSetIdentifiableConfiguration()
{
// Arrange
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), ConfigurationSource.Explicit);
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), false, ConfigurationSource.Explicit);
var entityTypeBuilder = new EntityTypeBuilder<TestEntity>(entityType);

// Act
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void ModelBuilder_IsSoftDeletable_WhenCalled_ItShouldSetSoftDeletableConf
public void EntityTypeBuilder_IsSoftDeletable_WhenNotCalled_ItShouldHaveNoConfiguration()
{
// Arrange
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), ConfigurationSource.Explicit);
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), false, ConfigurationSource.Explicit);

// Act
var result = new EntityTypeBuilder<TestEntity>(entityType);
Expand All @@ -75,7 +75,7 @@ public void EntityTypeBuilder_IsSoftDeletable_WhenNotCalled_ItShouldHaveNoConfig
public void EntityTypeBuilder_IsSoftDeletable_WhenCalled_ItShouldSetSoftDeletableConfiguration()
{
// Arrange
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), ConfigurationSource.Explicit);
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), false, ConfigurationSource.Explicit);
var entityTypeBuilder = new EntityTypeBuilder<TestEntity>(entityType);

// Act
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void ModelBuilder_IsTenantScopable_WhenCalled_ItShouldSetTenantScopableCo
public void EntityTypeBuilder_IsTenantScopable_WhenNotCalled_ItShouldHaveNoConfiguration()
{
// Arrange
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), ConfigurationSource.Explicit);
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), false, ConfigurationSource.Explicit);

// Act
var result = new EntityTypeBuilder<TestEntity>(entityType);
Expand All @@ -62,7 +62,7 @@ public void EntityTypeBuilder_IsTenantScopable_WhenNotCalled_ItShouldHaveNoConfi
public void EntityTypeBuilder_IsTenantScopable_WhenCalled_ItShouldSetTenantScopableConfiguration()
{
// Arrange
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), ConfigurationSource.Explicit);
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), false, ConfigurationSource.Explicit);
var entityTypeBuilder = new EntityTypeBuilder<TestEntity>(entityType);

// Act
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void ModelBuilder_IsTranslatable_WhenCalled_ItShouldSetTranslatableConfig
public void EntityTypeBuilder_IsTranslatable_WhenNotCalled_ItShouldHaveNoConfiguration()
{
// Arrange
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), ConfigurationSource.Explicit);
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), false, ConfigurationSource.Explicit);

// Act
var result = new EntityTypeBuilder<TestEntity>(entityType);
Expand All @@ -62,7 +62,7 @@ public void EntityTypeBuilder_IsTranslatable_WhenNotCalled_ItShouldHaveNoConfigu
public void EntityTypeBuilder_IsTranslatable_WhenCalled_ItShouldSetTranslatableConfiguration()
{
// Arrange
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), ConfigurationSource.Explicit);
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), false, ConfigurationSource.Explicit);
var entityTypeBuilder = new EntityTypeBuilder<TestEntity>(entityType);

// Act
Expand All @@ -77,7 +77,7 @@ public void EntityTypeBuilder_IsTranslatable_WhenCalled_ItShouldSetTranslatableC
public void EntityTypeBuilder_IsEntityTranslation_WhenNotCalled_ItShouldHaveNoConfiguration()
{
// Arrange
var entityType = new EntityType(typeof(TestEntityTranslation), new Model(new ConventionSet()), ConfigurationSource.Explicit);
var entityType = new EntityType(typeof(TestEntityTranslation), new Model(new ConventionSet()), false, ConfigurationSource.Explicit);

// Act
var result = new EntityTypeBuilder<TestEntityTranslation>(entityType);
Expand All @@ -92,7 +92,7 @@ public void EntityTypeBuilder_IsEntityTranslation_WhenNotCalled_ItShouldHaveNoCo
public void EntityTypeBuilder_IsEntityTranslation_WhenCalled_ItShouldSetTranslatableConfiguration()
{
// Arrange
var entityType = new EntityType(typeof(TestEntityTranslation), new Model(new ConventionSet()), ConfigurationSource.Explicit);
var entityType = new EntityType(typeof(TestEntityTranslation), new Model(new ConventionSet()), false, ConfigurationSource.Explicit);
var entityTypeBuilder = new EntityTypeBuilder<TestEntityTranslation>(entityType);

// Act
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void ModelBuilder_ConfigureEntityBehaviorTranslatedProperties_WhenCalled_
public void EntityTypeBuilder_HasTranslatedProperties_WhenNotCalled_ItShouldHaveNoConfiguration()
{
// Arrange
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), ConfigurationSource.Explicit);
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), false, ConfigurationSource.Explicit);

// Act
var result = new EntityTypeBuilder<TestEntity>(entityType);
Expand All @@ -54,7 +54,7 @@ public void EntityTypeBuilder_HasTranslatedProperties_WhenNotCalled_ItShouldHave
public void EntityTypeBuilder_HasTranslatedProperties_WhenCalled_ItShouldConfigureTranslatedProperties()
{
// Arrange
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), ConfigurationSource.Explicit);
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), false, ConfigurationSource.Explicit);
var entityTypeBuilder = new EntityTypeBuilder<TestEntity>(entityType);

// Act
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void ModelBuilder_ConfigureHasUtcDateTimeProperties_WhenCalled_ItShouldSe
public void EntityTypeBuilder_HasUtcDateTimeProperties_WhenNotCalled_ItShouldHaveNoConfiguration()
{
// Arrange
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), ConfigurationSource.Explicit);
var entityType = new EntityType(typeof(TestEntity), new Model(new ConventionSet()), false, ConfigurationSource.Explicit);

// Act
var result = new EntityTypeBuilder<TestEntity>(entityType);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">

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

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.0-preview-20201020-06" />
<PackageReference Include="Moq" Version="4.15.1" />
<PackageReference Include="Moq.AutoMock" Version="2.1.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="Moq.AutoMock" Version="3.1.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="1.3.0">
<PackageReference Include="coverlet.collector" Version="3.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Authors>Henk Kin</Authors>
<Description>Provides implementation for Data Access with EntityFrameworkCore.SqlServer. It provides implementation for IRepository&lt;T&gt; and DbContext. It also provides extension methods for IServiceCollection to easily adding types to .NET Core DependencyInjection. Is also supports using multiple DbContexts within same IUnitOfWork.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand All @@ -13,18 +13,18 @@
<PackageReleaseNotes></PackageReleaseNotes>
<Copyright>Henk Kin</Copyright>
<PackageTags>EntityFrameworkCore, EF, SqlServer, DependencyInjection, Multiple DbContext support, DataAccess, Repository, UnitOfWork, SoftDelete, Translation, Localization, RowVersioning, Multitenancy, Filtering, Paging, Sorting, Includes</PackageTags>
<Version>5.0.0</Version>
<Version>6.0.0</Version>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EntityCloner.Microsoft.EntityFrameworkCore" Version="5.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.0-beta-20204-02" PrivateAssets="All" />
<PackageReference Include="LinqKit.Microsoft.EntityFrameworkCore" Version="5.0.20" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="3.8.0-5.final" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.0" />
<PackageReference Include="EntityCloner.Microsoft.EntityFrameworkCore" Version="6.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="LinqKit.Microsoft.EntityFrameworkCore" Version="6.0.27" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public virtual void Validate(IDbContextOptions options)

private sealed class ExtensionInfo : DbContextOptionsExtensionInfo
{
private long? _serviceProviderHash;
private int? _serviceProviderHash;
private string _logFragment;

public ExtensionInfo(DataAccessClientOptionsExtension extension)
Expand Down Expand Up @@ -100,11 +100,11 @@ public override void PopulateDebugInfo(IDictionary<string, string> debugInfo)
hashCode.ToString(CultureInfo.InvariantCulture);
}

public override long GetServiceProviderHashCode()
public override int GetServiceProviderHashCode()
{
if (_serviceProviderHash == null)
{
var hashCode = Extension.EntityBehaviors?.GetHashCode() ?? 0L;
var hashCode = Extension.EntityBehaviors?.GetHashCode() ?? 0;
if (Extension.EntityBehaviors != null)
{
foreach (var entityBehaviorConfiguration in Extension.EntityBehaviors)
Expand All @@ -118,6 +118,9 @@ public override long GetServiceProviderHashCode()

return _serviceProviderHash.Value;
}

public override bool ShouldUseSameServiceProvider(DbContextOptionsExtensionInfo other)
=> other is DbContextOptionsExtensionInfo;// RelationalExtensionInfo;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ static SqlServerDbContext()

private readonly Action _dbContextResetStateMethod;
private readonly Func<CancellationToken, Task> _dbContextResetStateAsyncMethod;
private readonly Action<DbContextPoolConfigurationSnapshot> _dbContextResurrectMethod;

internal readonly DataAccessClientOptionsExtension DataAccessClientOptionsExtension;

Expand Down
16 changes: 8 additions & 8 deletions DataAccessClient.Tests/DataAccessClient.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

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

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="5.0.0-rc.2.*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.0-preview-20201020-06" />
<PackageReference Include="Moq" Version="4.15.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="1.3.0">
<PackageReference Include="coverlet.collector" Version="3.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Loading

0 comments on commit f500bee

Please sign in to comment.