Skip to content

Commit

Permalink
Added workaround for bug in EF Core 6.0.2 (#1139)
Browse files Browse the repository at this point in the history
* Added workaround for bug in EF Core 6.0.2

* Package updates

* Downgrade Microsoft.CodeAnalysis to fix cibuild
  • Loading branch information
Bart Koelman authored Feb 16, 2022
1 parent c214e19 commit bc5fbe0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<PropertyGroup>
<TargetFrameworkName>net6.0</TargetFrameworkName>
<AspNetVersion>6.0.*</AspNetVersion>
<EFCoreVersion>6.0.1</EFCoreVersion>
<EFCoreVersion>6.0.*</EFCoreVersion>
<EFCorePostgresVersion>6.0.*</EFCorePostgresVersion>
<MicrosoftCodeAnalysisVersion>4.*</MicrosoftCodeAnalysisVersion>
<MicrosoftCodeAnalysisVersion>4.0.*</MicrosoftCodeAnalysisVersion>
<HumanizerVersion>2.*</HumanizerVersion>
<JsonApiDotNetCoreVersionPrefix>5.0.0</JsonApiDotNetCoreVersionPrefix>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodingGuidelines.ruleset</CodeAnalysisRuleSet>
Expand All @@ -29,8 +29,8 @@

<!-- Test Project Dependencies -->
<PropertyGroup>
<CoverletVersion>3.1.0</CoverletVersion>
<CoverletVersion>3.1.2</CoverletVersion>
<MoqVersion>4.16.1</MoqVersion>
<TestSdkVersion>17.0.0</TestSdkVersion>
<TestSdkVersion>17.1.0</TestSdkVersion>
</PropertyGroup>
</Project>
6 changes: 6 additions & 0 deletions src/JsonApiDotNetCore/Configuration/JsonApiOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ public sealed class JsonApiOptions : IJsonApiOptions
}
};

static JsonApiOptions()
{
// Bug workaround for https://github.com/dotnet/efcore/issues/27436
AppContext.SetSwitch("Microsoft.EntityFrameworkCore.Issue26779", true);
}

public JsonApiOptions()
{
_lazySerializerReadOptions = new Lazy<JsonSerializerOptions>(() => new JsonSerializerOptions(SerializerOptions), LazyThreadSafetyMode.PublicationOnly);
Expand Down
2 changes: 1 addition & 1 deletion test/TestBuildingBlocks/TestBuildingBlocks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<ItemGroup>
<PackageReference Include="Bogus" Version="34.0.1" />
<PackageReference Include="coverlet.collector" Version="$(CoverletVersion)" PrivateAssets="All" />
<PackageReference Include="FluentAssertions" Version="6.2.0" />
<PackageReference Include="FluentAssertions" Version="6.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="$(AspNetVersion)" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="$(AspNetVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
Expand Down

0 comments on commit bc5fbe0

Please sign in to comment.