Skip to content

Commit 61947bb

Browse files
author
Bart Koelman
committed
Added workaround for bug in EF Core 6.0.2
1 parent c214e19 commit 61947bb

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<TargetFrameworkName>net6.0</TargetFrameworkName>
44
<AspNetVersion>6.0.*</AspNetVersion>
5-
<EFCoreVersion>6.0.1</EFCoreVersion>
5+
<EFCoreVersion>6.0.*</EFCoreVersion>
66
<EFCorePostgresVersion>6.0.*</EFCorePostgresVersion>
77
<MicrosoftCodeAnalysisVersion>4.*</MicrosoftCodeAnalysisVersion>
88
<HumanizerVersion>2.*</HumanizerVersion>

src/JsonApiDotNetCore/Configuration/JsonApiOptions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ public sealed class JsonApiOptions : IJsonApiOptions
102102
}
103103
};
104104

105+
static JsonApiOptions()
106+
{
107+
// Bug workaround for https://github.com/dotnet/efcore/issues/27436
108+
AppContext.SetSwitch("Microsoft.EntityFrameworkCore.Issue26779", true);
109+
}
110+
105111
public JsonApiOptions()
106112
{
107113
_lazySerializerReadOptions = new Lazy<JsonSerializerOptions>(() => new JsonSerializerOptions(SerializerOptions), LazyThreadSafetyMode.PublicationOnly);

0 commit comments

Comments
 (0)