From c2941e740120acc0fa3782d75564ecbde59b9b4f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2026 20:29:04 +0000 Subject: [PATCH 1/6] [release/10.0] Source code updates from dotnet/dotnet (#37822) [release/10.0] Source code updates from dotnet/dotnet --- NuGet.config | 2 +- eng/Version.Details.props | 36 +++++++++---------- eng/Version.Details.xml | 74 +++++++++++++++++++-------------------- eng/Versions.props | 2 +- global.json | 4 +-- 5 files changed, 59 insertions(+), 59 deletions(-) diff --git a/NuGet.config b/NuGet.config index 500f8333385..f199eae2aaf 100644 --- a/NuGet.config +++ b/NuGet.config @@ -4,7 +4,7 @@ - + diff --git a/eng/Version.Details.props b/eng/Version.Details.props index c99a63a265a..5869483f9f0 100644 --- a/eng/Version.Details.props +++ b/eng/Version.Details.props @@ -6,24 +6,24 @@ This file should be imported by eng/Versions.props - 10.0.0-beta.26124.113 - 10.0.0-beta.26124.113 - 10.0.0-beta.26124.113 - 10.0.5 - 10.0.5 - 10.0.5 - 10.0.5 - 10.0.5 - 10.0.5 - 10.0.5 - 10.0.5-servicing.26124.113 - 10.0.5 - 10.0.5 - 10.0.5-servicing.26124.113 - 10.0.5 - 10.0.5 - 10.0.5 - 10.0.5 + 10.0.0-beta.26127.123 + 10.0.0-beta.26127.123 + 10.0.0-beta.26127.123 + 10.0.6 + 10.0.6 + 10.0.6 + 10.0.6 + 10.0.6 + 10.0.6 + 10.0.6 + 10.0.6-servicing.26127.123 + 10.0.6 + 10.0.6 + 10.0.6-servicing.26127.123 + 10.0.6 + 10.0.6 + 10.0.6 + 10.0.6 diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index ab85d2406dc..ae741bad3d6 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,80 +1,80 @@ - + - + https://github.com/dotnet/dotnet - 4f2d31c20fb1dea7a279c108c4fb2bf02824afee + 709d43145cfab0eda75bd2ccbf7723e998c78d4f - + https://github.com/dotnet/dotnet - 4f2d31c20fb1dea7a279c108c4fb2bf02824afee + 709d43145cfab0eda75bd2ccbf7723e998c78d4f - + https://github.com/dotnet/dotnet - 4f2d31c20fb1dea7a279c108c4fb2bf02824afee + 709d43145cfab0eda75bd2ccbf7723e998c78d4f - + https://github.com/dotnet/dotnet - 4f2d31c20fb1dea7a279c108c4fb2bf02824afee + 709d43145cfab0eda75bd2ccbf7723e998c78d4f - + https://github.com/dotnet/dotnet - 4f2d31c20fb1dea7a279c108c4fb2bf02824afee + 709d43145cfab0eda75bd2ccbf7723e998c78d4f - + https://github.com/dotnet/dotnet - 4f2d31c20fb1dea7a279c108c4fb2bf02824afee + 709d43145cfab0eda75bd2ccbf7723e998c78d4f - + https://github.com/dotnet/dotnet - 4f2d31c20fb1dea7a279c108c4fb2bf02824afee + 709d43145cfab0eda75bd2ccbf7723e998c78d4f - + https://github.com/dotnet/dotnet - 4f2d31c20fb1dea7a279c108c4fb2bf02824afee + 709d43145cfab0eda75bd2ccbf7723e998c78d4f - + https://github.com/dotnet/dotnet - 4f2d31c20fb1dea7a279c108c4fb2bf02824afee + 709d43145cfab0eda75bd2ccbf7723e998c78d4f - + https://github.com/dotnet/dotnet - 4f2d31c20fb1dea7a279c108c4fb2bf02824afee + 709d43145cfab0eda75bd2ccbf7723e998c78d4f - + https://github.com/dotnet/dotnet - 4f2d31c20fb1dea7a279c108c4fb2bf02824afee + 709d43145cfab0eda75bd2ccbf7723e998c78d4f - + https://github.com/dotnet/dotnet - 4f2d31c20fb1dea7a279c108c4fb2bf02824afee + 709d43145cfab0eda75bd2ccbf7723e998c78d4f - + https://github.com/dotnet/dotnet - 4f2d31c20fb1dea7a279c108c4fb2bf02824afee + 709d43145cfab0eda75bd2ccbf7723e998c78d4f - + https://github.com/dotnet/dotnet - 4f2d31c20fb1dea7a279c108c4fb2bf02824afee + 709d43145cfab0eda75bd2ccbf7723e998c78d4f - + https://github.com/dotnet/dotnet - 4f2d31c20fb1dea7a279c108c4fb2bf02824afee + 709d43145cfab0eda75bd2ccbf7723e998c78d4f - + https://github.com/dotnet/dotnet - 4f2d31c20fb1dea7a279c108c4fb2bf02824afee + 709d43145cfab0eda75bd2ccbf7723e998c78d4f - + https://github.com/dotnet/dotnet - 4f2d31c20fb1dea7a279c108c4fb2bf02824afee + 709d43145cfab0eda75bd2ccbf7723e998c78d4f - + https://github.com/dotnet/dotnet - 4f2d31c20fb1dea7a279c108c4fb2bf02824afee + 709d43145cfab0eda75bd2ccbf7723e998c78d4f diff --git a/eng/Versions.props b/eng/Versions.props index e027bd6e3d4..d040107ab1b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -1,7 +1,7 @@ - 10.0.5 + 10.0.6 servicing False diff --git a/global.json b/global.json index 0048e3e15e9..d6288768f64 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.26124.113", - "Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.26124.113" + "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.26127.123", + "Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.26127.123" } } From d072427012186855f64d089b4c420eed2aac0fb3 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 3 Mar 2026 02:13:56 +0000 Subject: [PATCH 2/6] Update dependencies from build 304097 (#37828) [release/10.0] Source code updates from dotnet/dotnet --- NuGet.config | 2 +- eng/Version.Details.props | 10 ++++---- eng/Version.Details.xml | 48 +++++++++++++++++++-------------------- global.json | 4 ++-- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/NuGet.config b/NuGet.config index f199eae2aaf..260a19eae5c 100644 --- a/NuGet.config +++ b/NuGet.config @@ -4,7 +4,7 @@ - + diff --git a/eng/Version.Details.props b/eng/Version.Details.props index 5869483f9f0..977fef0d44b 100644 --- a/eng/Version.Details.props +++ b/eng/Version.Details.props @@ -6,9 +6,9 @@ This file should be imported by eng/Versions.props - 10.0.0-beta.26127.123 - 10.0.0-beta.26127.123 - 10.0.0-beta.26127.123 + 10.0.0-beta.26152.107 + 10.0.0-beta.26152.107 + 10.0.0-beta.26152.107 10.0.6 10.0.6 10.0.6 @@ -16,10 +16,10 @@ This file should be imported by eng/Versions.props 10.0.6 10.0.6 10.0.6 - 10.0.6-servicing.26127.123 + 10.0.6-servicing.26152.107 10.0.6 10.0.6 - 10.0.6-servicing.26127.123 + 10.0.6-servicing.26152.107 10.0.6 10.0.6 10.0.6 diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index ae741bad3d6..f63e7221f77 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,80 +1,80 @@ - + https://github.com/dotnet/dotnet - 709d43145cfab0eda75bd2ccbf7723e998c78d4f + 12c3cef498be4615913f63b1ae356b475efa2488 https://github.com/dotnet/dotnet - 709d43145cfab0eda75bd2ccbf7723e998c78d4f + 12c3cef498be4615913f63b1ae356b475efa2488 https://github.com/dotnet/dotnet - 709d43145cfab0eda75bd2ccbf7723e998c78d4f + 12c3cef498be4615913f63b1ae356b475efa2488 https://github.com/dotnet/dotnet - 709d43145cfab0eda75bd2ccbf7723e998c78d4f + 12c3cef498be4615913f63b1ae356b475efa2488 https://github.com/dotnet/dotnet - 709d43145cfab0eda75bd2ccbf7723e998c78d4f + 12c3cef498be4615913f63b1ae356b475efa2488 https://github.com/dotnet/dotnet - 709d43145cfab0eda75bd2ccbf7723e998c78d4f + 12c3cef498be4615913f63b1ae356b475efa2488 https://github.com/dotnet/dotnet - 709d43145cfab0eda75bd2ccbf7723e998c78d4f + 12c3cef498be4615913f63b1ae356b475efa2488 - + https://github.com/dotnet/dotnet - 709d43145cfab0eda75bd2ccbf7723e998c78d4f + 12c3cef498be4615913f63b1ae356b475efa2488 https://github.com/dotnet/dotnet - 709d43145cfab0eda75bd2ccbf7723e998c78d4f + 12c3cef498be4615913f63b1ae356b475efa2488 https://github.com/dotnet/dotnet - 709d43145cfab0eda75bd2ccbf7723e998c78d4f + 12c3cef498be4615913f63b1ae356b475efa2488 - + https://github.com/dotnet/dotnet - 709d43145cfab0eda75bd2ccbf7723e998c78d4f + 12c3cef498be4615913f63b1ae356b475efa2488 https://github.com/dotnet/dotnet - 709d43145cfab0eda75bd2ccbf7723e998c78d4f + 12c3cef498be4615913f63b1ae356b475efa2488 https://github.com/dotnet/dotnet - 709d43145cfab0eda75bd2ccbf7723e998c78d4f + 12c3cef498be4615913f63b1ae356b475efa2488 https://github.com/dotnet/dotnet - 709d43145cfab0eda75bd2ccbf7723e998c78d4f + 12c3cef498be4615913f63b1ae356b475efa2488 https://github.com/dotnet/dotnet - 709d43145cfab0eda75bd2ccbf7723e998c78d4f + 12c3cef498be4615913f63b1ae356b475efa2488 - + https://github.com/dotnet/dotnet - 709d43145cfab0eda75bd2ccbf7723e998c78d4f + 12c3cef498be4615913f63b1ae356b475efa2488 - + https://github.com/dotnet/dotnet - 709d43145cfab0eda75bd2ccbf7723e998c78d4f + 12c3cef498be4615913f63b1ae356b475efa2488 - + https://github.com/dotnet/dotnet - 709d43145cfab0eda75bd2ccbf7723e998c78d4f + 12c3cef498be4615913f63b1ae356b475efa2488 diff --git a/global.json b/global.json index d6288768f64..81e2daac55b 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.26127.123", - "Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.26127.123" + "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.26152.107", + "Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.26152.107" } } From fdf01edf7a92b6926798c99c67fe534d9a4b3487 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 3 Mar 2026 09:34:08 +0000 Subject: [PATCH 3/6] [release/10.0] Source code updates from dotnet/dotnet (#37830) [release/10.0] Source code updates from dotnet/dotnet --- NuGet.config | 2 +- eng/Version.Details.props | 10 ++++---- eng/Version.Details.xml | 48 +++++++++++++++++++-------------------- global.json | 4 ++-- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/NuGet.config b/NuGet.config index 260a19eae5c..80956615ff3 100644 --- a/NuGet.config +++ b/NuGet.config @@ -4,7 +4,7 @@ - + diff --git a/eng/Version.Details.props b/eng/Version.Details.props index 977fef0d44b..c4d5242eb4f 100644 --- a/eng/Version.Details.props +++ b/eng/Version.Details.props @@ -6,9 +6,9 @@ This file should be imported by eng/Versions.props - 10.0.0-beta.26152.107 - 10.0.0-beta.26152.107 - 10.0.0-beta.26152.107 + 10.0.0-beta.26152.114 + 10.0.0-beta.26152.114 + 10.0.0-beta.26152.114 10.0.6 10.0.6 10.0.6 @@ -16,10 +16,10 @@ This file should be imported by eng/Versions.props 10.0.6 10.0.6 10.0.6 - 10.0.6-servicing.26152.107 + 10.0.6-servicing.26152.114 10.0.6 10.0.6 - 10.0.6-servicing.26152.107 + 10.0.6-servicing.26152.114 10.0.6 10.0.6 10.0.6 diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index f63e7221f77..7f45ee55d56 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,80 +1,80 @@ - + https://github.com/dotnet/dotnet - 12c3cef498be4615913f63b1ae356b475efa2488 + 4b20ff14ee9608ff6708b05d18d1488457704a87 https://github.com/dotnet/dotnet - 12c3cef498be4615913f63b1ae356b475efa2488 + 4b20ff14ee9608ff6708b05d18d1488457704a87 https://github.com/dotnet/dotnet - 12c3cef498be4615913f63b1ae356b475efa2488 + 4b20ff14ee9608ff6708b05d18d1488457704a87 https://github.com/dotnet/dotnet - 12c3cef498be4615913f63b1ae356b475efa2488 + 4b20ff14ee9608ff6708b05d18d1488457704a87 https://github.com/dotnet/dotnet - 12c3cef498be4615913f63b1ae356b475efa2488 + 4b20ff14ee9608ff6708b05d18d1488457704a87 https://github.com/dotnet/dotnet - 12c3cef498be4615913f63b1ae356b475efa2488 + 4b20ff14ee9608ff6708b05d18d1488457704a87 https://github.com/dotnet/dotnet - 12c3cef498be4615913f63b1ae356b475efa2488 + 4b20ff14ee9608ff6708b05d18d1488457704a87 - + https://github.com/dotnet/dotnet - 12c3cef498be4615913f63b1ae356b475efa2488 + 4b20ff14ee9608ff6708b05d18d1488457704a87 https://github.com/dotnet/dotnet - 12c3cef498be4615913f63b1ae356b475efa2488 + 4b20ff14ee9608ff6708b05d18d1488457704a87 https://github.com/dotnet/dotnet - 12c3cef498be4615913f63b1ae356b475efa2488 + 4b20ff14ee9608ff6708b05d18d1488457704a87 - + https://github.com/dotnet/dotnet - 12c3cef498be4615913f63b1ae356b475efa2488 + 4b20ff14ee9608ff6708b05d18d1488457704a87 https://github.com/dotnet/dotnet - 12c3cef498be4615913f63b1ae356b475efa2488 + 4b20ff14ee9608ff6708b05d18d1488457704a87 https://github.com/dotnet/dotnet - 12c3cef498be4615913f63b1ae356b475efa2488 + 4b20ff14ee9608ff6708b05d18d1488457704a87 https://github.com/dotnet/dotnet - 12c3cef498be4615913f63b1ae356b475efa2488 + 4b20ff14ee9608ff6708b05d18d1488457704a87 https://github.com/dotnet/dotnet - 12c3cef498be4615913f63b1ae356b475efa2488 + 4b20ff14ee9608ff6708b05d18d1488457704a87 - + https://github.com/dotnet/dotnet - 12c3cef498be4615913f63b1ae356b475efa2488 + 4b20ff14ee9608ff6708b05d18d1488457704a87 - + https://github.com/dotnet/dotnet - 12c3cef498be4615913f63b1ae356b475efa2488 + 4b20ff14ee9608ff6708b05d18d1488457704a87 - + https://github.com/dotnet/dotnet - 12c3cef498be4615913f63b1ae356b475efa2488 + 4b20ff14ee9608ff6708b05d18d1488457704a87 diff --git a/global.json b/global.json index 81e2daac55b..929631355db 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.26152.107", - "Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.26152.107" + "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.26152.114", + "Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.26152.114" } } From a24cf33dbdf2afc6c37c23d8004cd1e6bb302105 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 3 Mar 2026 16:05:53 +0000 Subject: [PATCH 4/6] Update dependencies from build 304232 (#37832) [release/10.0] Source code updates from dotnet/dotnet --- NuGet.config | 2 +- eng/Version.Details.props | 10 ++++---- eng/Version.Details.xml | 48 +++++++++++++++++++-------------------- global.json | 4 ++-- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/NuGet.config b/NuGet.config index 80956615ff3..63a0a9bcb86 100644 --- a/NuGet.config +++ b/NuGet.config @@ -4,7 +4,7 @@ - + diff --git a/eng/Version.Details.props b/eng/Version.Details.props index c4d5242eb4f..9e6c6ab4a91 100644 --- a/eng/Version.Details.props +++ b/eng/Version.Details.props @@ -6,9 +6,9 @@ This file should be imported by eng/Versions.props - 10.0.0-beta.26152.114 - 10.0.0-beta.26152.114 - 10.0.0-beta.26152.114 + 10.0.0-beta.26152.119 + 10.0.0-beta.26152.119 + 10.0.0-beta.26152.119 10.0.6 10.0.6 10.0.6 @@ -16,10 +16,10 @@ This file should be imported by eng/Versions.props 10.0.6 10.0.6 10.0.6 - 10.0.6-servicing.26152.114 + 10.0.6-servicing.26152.119 10.0.6 10.0.6 - 10.0.6-servicing.26152.114 + 10.0.6-servicing.26152.119 10.0.6 10.0.6 10.0.6 diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 7f45ee55d56..9b5c9e866a7 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,80 +1,80 @@ - + https://github.com/dotnet/dotnet - 4b20ff14ee9608ff6708b05d18d1488457704a87 + e26c1619ac4f49b33d663e0e6a236802030afed4 https://github.com/dotnet/dotnet - 4b20ff14ee9608ff6708b05d18d1488457704a87 + e26c1619ac4f49b33d663e0e6a236802030afed4 https://github.com/dotnet/dotnet - 4b20ff14ee9608ff6708b05d18d1488457704a87 + e26c1619ac4f49b33d663e0e6a236802030afed4 https://github.com/dotnet/dotnet - 4b20ff14ee9608ff6708b05d18d1488457704a87 + e26c1619ac4f49b33d663e0e6a236802030afed4 https://github.com/dotnet/dotnet - 4b20ff14ee9608ff6708b05d18d1488457704a87 + e26c1619ac4f49b33d663e0e6a236802030afed4 https://github.com/dotnet/dotnet - 4b20ff14ee9608ff6708b05d18d1488457704a87 + e26c1619ac4f49b33d663e0e6a236802030afed4 https://github.com/dotnet/dotnet - 4b20ff14ee9608ff6708b05d18d1488457704a87 + e26c1619ac4f49b33d663e0e6a236802030afed4 - + https://github.com/dotnet/dotnet - 4b20ff14ee9608ff6708b05d18d1488457704a87 + e26c1619ac4f49b33d663e0e6a236802030afed4 https://github.com/dotnet/dotnet - 4b20ff14ee9608ff6708b05d18d1488457704a87 + e26c1619ac4f49b33d663e0e6a236802030afed4 https://github.com/dotnet/dotnet - 4b20ff14ee9608ff6708b05d18d1488457704a87 + e26c1619ac4f49b33d663e0e6a236802030afed4 - + https://github.com/dotnet/dotnet - 4b20ff14ee9608ff6708b05d18d1488457704a87 + e26c1619ac4f49b33d663e0e6a236802030afed4 https://github.com/dotnet/dotnet - 4b20ff14ee9608ff6708b05d18d1488457704a87 + e26c1619ac4f49b33d663e0e6a236802030afed4 https://github.com/dotnet/dotnet - 4b20ff14ee9608ff6708b05d18d1488457704a87 + e26c1619ac4f49b33d663e0e6a236802030afed4 https://github.com/dotnet/dotnet - 4b20ff14ee9608ff6708b05d18d1488457704a87 + e26c1619ac4f49b33d663e0e6a236802030afed4 https://github.com/dotnet/dotnet - 4b20ff14ee9608ff6708b05d18d1488457704a87 + e26c1619ac4f49b33d663e0e6a236802030afed4 - + https://github.com/dotnet/dotnet - 4b20ff14ee9608ff6708b05d18d1488457704a87 + e26c1619ac4f49b33d663e0e6a236802030afed4 - + https://github.com/dotnet/dotnet - 4b20ff14ee9608ff6708b05d18d1488457704a87 + e26c1619ac4f49b33d663e0e6a236802030afed4 - + https://github.com/dotnet/dotnet - 4b20ff14ee9608ff6708b05d18d1488457704a87 + e26c1619ac4f49b33d663e0e6a236802030afed4 diff --git a/global.json b/global.json index 929631355db..9d645df1fc6 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.26152.114", - "Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.26152.114" + "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.26152.119", + "Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.26152.119" } } From 6a7fa6163f38cd2c55984a03c6019c3f37486048 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 5 Mar 2026 00:44:54 +0200 Subject: [PATCH 5/6] Fix complex property JSON column not marked nullable in TPH hierarchy (#37781) Fixes #37404 Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com> --- .../Metadata/Internal/RelationalModel.cs | 7 +++- .../Metadata/RelationalModelTest.cs | 32 +++++++++++++++++++ .../ComplexTypes/DbContextModelBuilder.cs | 5 ++- 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/src/EFCore.Relational/Metadata/Internal/RelationalModel.cs b/src/EFCore.Relational/Metadata/Internal/RelationalModel.cs index 9f6c26fb8fb..1df7270a58f 100644 --- a/src/EFCore.Relational/Metadata/Internal/RelationalModel.cs +++ b/src/EFCore.Relational/Metadata/Internal/RelationalModel.cs @@ -634,8 +634,13 @@ private static void CreateContainerColumn( { complexType = (IComplexType)mappedType; #pragma warning disable EF1001 // Internal EF Core API usage. + var chain = complexType.ComplexProperty.GetChainToComplexProperty(fromEntity: true); jsonColumn.IsNullable = complexType.ComplexProperty.IsNullable - || complexType.ComplexProperty.GetChainToComplexProperty(fromEntity: true).Any(p => p.IsNullable); + || (chain[0].DeclaringType is IEntityType declaringEntityType + && declaringEntityType.BaseType != null + && (declaringEntityType.GetMappingStrategy() ?? RelationalAnnotationNames.TphMappingStrategy) + == RelationalAnnotationNames.TphMappingStrategy) + || chain.Any(p => p.IsNullable); #pragma warning restore EF1001 // Internal EF Core API usage. } } diff --git a/test/EFCore.Relational.Tests/Metadata/RelationalModelTest.cs b/test/EFCore.Relational.Tests/Metadata/RelationalModelTest.cs index cff152fe567..ef756bd56ed 100644 --- a/test/EFCore.Relational.Tests/Metadata/RelationalModelTest.cs +++ b/test/EFCore.Relational.Tests/Metadata/RelationalModelTest.cs @@ -3201,6 +3201,26 @@ public void Container_column_type_is_used_for_complex_collection_json_column() Assert.IsType(jsonColumn); } + [ConditionalFact] + public void Complex_property_json_column_is_nullable_in_TPH_hierarchy() + { + var modelBuilder = CreateConventionModelBuilder(); + + modelBuilder.Entity(); + modelBuilder.Entity(); + modelBuilder.Entity() + .ComplexProperty(e => e.ComplexProperty, b => b.ToJson()); + + var model = modelBuilder.FinalizeModel(); + var relationalModel = model.GetRelationalModel(); + + var table = relationalModel.Tables.Single(); + var jsonColumn = table.Columns.Single(c => c.Name == "ComplexProperty"); + + Assert.True(jsonColumn.IsNullable); + Assert.IsType(jsonColumn); + } + private static IRelationalModel Finalize(TestHelpers.TestModelBuilder modelBuilder) => modelBuilder.FinalizeModel(designTime: true).GetRelationalModel(); @@ -3318,6 +3338,18 @@ private class EntityWithComplexCollection public List ComplexCollection { get; set; } } + private abstract class TphBaseEntity + { + public int Id { get; set; } + } + + private class EntityWithoutComplexProperty : TphBaseEntity; + + private class TphEntityWithComplexProperty : TphBaseEntity + { + public ComplexData ComplexProperty { get; set; } + } + private class ComplexData { public string Value { get; set; } diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/ComplexTypes/DbContextModelBuilder.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/ComplexTypes/DbContextModelBuilder.cs index e7e1b974016..4b02f75417a 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/ComplexTypes/DbContextModelBuilder.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/ComplexTypes/DbContextModelBuilder.cs @@ -406,7 +406,10 @@ private IRelationalModel CreateRelationalModel() var flagsEnum2Column = new Column("FlagsEnum2", "int", principalBaseTable); principalBaseTable.Columns.Add("FlagsEnum2", flagsEnum2Column); flagsEnum2Column.Accessors = ColumnAccessorsFactory.CreateGeneric(flagsEnum2Column); - var manyOwnedColumn = new JsonColumn("ManyOwned", "nvarchar(max)", principalBaseTable); + var manyOwnedColumn = new JsonColumn("ManyOwned", "nvarchar(max)", principalBaseTable) + { + IsNullable = true + }; principalBaseTable.Columns.Add("ManyOwned", manyOwnedColumn); manyOwnedColumn.Accessors = ColumnAccessorsFactory.CreateGeneric(manyOwnedColumn); var owned_NumberColumn = new Column("Owned_Number", "int", principalBaseTable); From e7852dcecab8ccf6235a14057c5648e4a3bd6841 Mon Sep 17 00:00:00 2001 From: Andriy Svyryd Date: Wed, 4 Mar 2026 14:56:33 -0800 Subject: [PATCH 6/6] Refactor jsonColumn nullability logic in RelationalModel Remove unnecessary nullability check for jsonColumn in TPH mapping. --- .../Metadata/Internal/RelationalModel.cs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/EFCore.Relational/Metadata/Internal/RelationalModel.cs b/src/EFCore.Relational/Metadata/Internal/RelationalModel.cs index 3aed2fe8a5f..82e8d0b5e89 100644 --- a/src/EFCore.Relational/Metadata/Internal/RelationalModel.cs +++ b/src/EFCore.Relational/Metadata/Internal/RelationalModel.cs @@ -650,16 +650,6 @@ private static void CreateContainerColumn( == RelationalAnnotationNames.TphMappingStrategy) || chain.Any(p => p.IsNullable); #pragma warning restore EF1001 // Internal EF Core API usage. - - var declaringType = complexType.ComplexProperty.DeclaringType; - if (!jsonColumn.IsNullable - && declaringType is IEntityType declaringEntityType - && declaringEntityType.BaseType != null - && declaringEntityType.GetMappingStrategy() == RelationalAnnotationNames.TphMappingStrategy) - { - // if complex property is defined on a derived type in TPH, the column must be made nullable - jsonColumn.IsNullable = true; - } } }