From 5d1235a1c2439330012a90af20f1de637e4b0388 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 19:07:19 +0000 Subject: [PATCH 1/3] Update dependencies from https://github.com/dotnet/arcade build 20231114.5 (#32311) [release/7.0] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 2 +- eng/common/templates/post-build/common-variables.yml | 1 - global.json | 4 ++-- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index a290860ebe3..64f3151ff97 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -39,17 +39,17 @@ - + https://github.com/dotnet/arcade - acb831a5b31a3cc4a744a8944b6bd172e6969234 + ca53a3149aaedb03e5d79ee0e259d31ac8719290 - + https://github.com/dotnet/arcade - acb831a5b31a3cc4a744a8944b6bd172e6969234 + ca53a3149aaedb03e5d79ee0e259d31ac8719290 - + https://github.com/dotnet/arcade - acb831a5b31a3cc4a744a8944b6bd172e6969234 + ca53a3149aaedb03e5d79ee0e259d31ac8719290 diff --git a/eng/Versions.props b/eng/Versions.props index 5ba3728fcf1..d5102f69b3a 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -25,7 +25,7 @@ 7.0.0 - 7.0.0-beta.23511.9 + 7.0.0-beta.23564.5 diff --git a/eng/common/templates/post-build/common-variables.yml b/eng/common/templates/post-build/common-variables.yml index 1ac7f49a43c..776bd970017 100644 --- a/eng/common/templates/post-build/common-variables.yml +++ b/eng/common/templates/post-build/common-variables.yml @@ -1,6 +1,5 @@ variables: - group: AzureDevOps-Artifact-Feeds-Pats - - group: DotNet-Blob-Feed - group: DotNet-DotNetCli-Storage - group: DotNet-MSRC-Storage - group: Publish-Build-Assets diff --git a/global.json b/global.json index 1b80990dff2..593e6eaf20d 100644 --- a/global.json +++ b/global.json @@ -8,7 +8,7 @@ "rollForward": "latestMajor" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.23511.9", - "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.23511.9" + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.23564.5", + "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.23564.5" } } From 03866456edec2eb362b4aaf1e344d510222d177b Mon Sep 17 00:00:00 2001 From: Arthur Vickers Date: Tue, 21 Nov 2023 19:23:52 +0000 Subject: [PATCH 2/3] [release/8.0] Don't throw when attempting to load from a newly Added entity with unknown FK values (#32368) --- src/EFCore/Internal/EntityFinder.cs | 6 +++++- test/EFCore.Specification.Tests/LazyLoadTestBase.cs | 12 ++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/EFCore/Internal/EntityFinder.cs b/src/EFCore/Internal/EntityFinder.cs index 2e06583056c..6e95ffababe 100644 --- a/src/EFCore/Internal/EntityFinder.cs +++ b/src/EFCore/Internal/EntityFinder.cs @@ -15,6 +15,9 @@ namespace Microsoft.EntityFrameworkCore.Internal; public class EntityFinder : IEntityFinder where TEntity : class { + private static readonly bool UseOldBehavior32314 = + AppContext.TryGetSwitch("Microsoft.EntityFrameworkCore.Issue32314", out var enabled32314) && enabled32314; + private readonly IStateManager _stateManager; private readonly IDbSetSource _setSource; private readonly IDbSetCache _setCache; @@ -715,7 +718,8 @@ IQueryable IEntityFinder.Query(INavigation navigation, InternalEntityEntry entry for (var i = 0; i < values.Length; i++) { var property = properties[i]; - if (property.IsShadowProperty() && (detached || entry.IsUnknown(property))) + if (property.IsShadowProperty() && (detached + || ((UseOldBehavior32314 || entry.EntityState != EntityState.Added) && entry.IsUnknown(property)))) { throw new InvalidOperationException( CoreStrings.CannotLoadDetachedShadow(navigation.Name, entry.EntityType.DisplayName())); diff --git a/test/EFCore.Specification.Tests/LazyLoadTestBase.cs b/test/EFCore.Specification.Tests/LazyLoadTestBase.cs index fc6e6e3af0b..0328a2675f3 100644 --- a/test/EFCore.Specification.Tests/LazyLoadTestBase.cs +++ b/test/EFCore.Specification.Tests/LazyLoadTestBase.cs @@ -2006,7 +2006,8 @@ public virtual void Lazy_load_many_to_one_reference_to_principal_shadow_fk( if (LazyLoadingEnabled) { - if (state == EntityState.Detached && queryTrackingBehavior == QueryTrackingBehavior.TrackAll) + if (state == EntityState.Detached && queryTrackingBehavior == QueryTrackingBehavior.TrackAll + || state == EntityState.Added && queryTrackingBehavior != QueryTrackingBehavior.TrackAll) { Assert.Null(child.Parent); // Explicitly detached } @@ -2094,7 +2095,8 @@ public virtual void Lazy_load_one_to_one_reference_to_principal_shadow_fk( if (LazyLoadingEnabled) { - if (state == EntityState.Detached && queryTrackingBehavior == QueryTrackingBehavior.TrackAll) + if (state == EntityState.Detached && queryTrackingBehavior == QueryTrackingBehavior.TrackAll + || state == EntityState.Added && queryTrackingBehavior != QueryTrackingBehavior.TrackAll) { Assert.Null(single.Parent); // Explicitly detached } @@ -2258,7 +2260,8 @@ public virtual void Lazy_load_many_to_one_reference_to_principal_null_FK_shadow_ { Assert.Null(child.Parent); // Explicitly detached } - else if (queryTrackingBehavior != QueryTrackingBehavior.TrackAll) + else if (queryTrackingBehavior != QueryTrackingBehavior.TrackAll + && state != EntityState.Added) { Assert.Equal( CoreStrings.CannotLoadDetachedShadow("Parent", "ChildShadowFk"), @@ -2327,7 +2330,8 @@ public virtual void Lazy_load_one_to_one_reference_to_principal_null_FK_shadow_f { Assert.Null(single.Parent); } - else if (queryTrackingBehavior != QueryTrackingBehavior.TrackAll) + else if (queryTrackingBehavior != QueryTrackingBehavior.TrackAll + && state != EntityState.Added) { Assert.Equal( CoreStrings.CannotLoadDetachedShadow("Parent", "SingleShadowFk"), From e6291bf34261523a18c7f221e98f08508a9b710d Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Tue, 21 Nov 2023 21:25:14 +0100 Subject: [PATCH 3/3] [release/7.0] Fix to #31448 Use token for NonQueryResultAsync (#31449) (#32334) Fixes #31448 (cherry picked from commit d2f824a0efb67216b145e5d5759e9d2f623a0e82) Co-authored-by: Gordeev Dmitry --- .../Query/RelationalShapedQueryCompilingExpressionVisitor.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/EFCore.Relational/Query/RelationalShapedQueryCompilingExpressionVisitor.cs b/src/EFCore.Relational/Query/RelationalShapedQueryCompilingExpressionVisitor.cs index e623a1e92e7..a41535e943a 100644 --- a/src/EFCore.Relational/Query/RelationalShapedQueryCompilingExpressionVisitor.cs +++ b/src/EFCore.Relational/Query/RelationalShapedQueryCompilingExpressionVisitor.cs @@ -200,7 +200,8 @@ private static Task NonQueryResultAsync( state.commandSource), cancellationToken); }, - null); + null, + relationalQueryContext.CancellationToken); } finally {