diff --git a/eng/Version.Details.props b/eng/Version.Details.props index 6f8a2518e65..08c7c839272 100644 --- a/eng/Version.Details.props +++ b/eng/Version.Details.props @@ -27,7 +27,7 @@ This file should be imported by eng/Versions.props - + $(MicrosoftDotNetArcadeSdkPackageVersion) $(MicrosoftDotNetBuildTasksTemplatingPackageVersion) $(MicrosoftDotNetHelixSdkPackageVersion) diff --git a/eng/common/core-templates/steps/publish-logs.yml b/eng/common/core-templates/steps/publish-logs.yml index 5a927b4c7bc..a9ea99ba6aa 100644 --- a/eng/common/core-templates/steps/publish-logs.yml +++ b/eng/common/core-templates/steps/publish-logs.yml @@ -31,7 +31,6 @@ steps: -runtimeSourceFeed https://ci.dot.net/internal -runtimeSourceFeedKey '$(dotnetbuilds-internal-container-read-token-base64)' '$(publishing-dnceng-devdiv-code-r-build-re)' - '$(MaestroAccessToken)' '$(dn-bot-all-orgs-artifact-feeds-rw)' '$(akams-client-id)' '$(microsoft-symbol-server-pat)' diff --git a/eng/common/templates/post-build/post-build.yml b/eng/common/templates/post-build/post-build.yml index ef8cf549113..53ede714bdd 100644 --- a/eng/common/templates/post-build/post-build.yml +++ b/eng/common/templates/post-build/post-build.yml @@ -5,4 +5,4 @@ stages: is1ESPipeline: false ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} + ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/src/EFCore/Query/Internal/StructuralTypeMaterializerSource.cs b/src/EFCore/Query/Internal/StructuralTypeMaterializerSource.cs index 2bbe52d34a4..aee6fef4206 100644 --- a/src/EFCore/Query/Internal/StructuralTypeMaterializerSource.cs +++ b/src/EFCore/Query/Internal/StructuralTypeMaterializerSource.cs @@ -204,7 +204,12 @@ IServiceProperty serviceProperty IComplexProperty complexProperty => CreateMaterializeExpression( - new StructuralTypeMaterializerSourceParameters(complexProperty.ComplexType, "complexType", complexProperty.ClrType, nullable || complexProperty.IsNullable, QueryTrackingBehavior: null), + new StructuralTypeMaterializerSourceParameters( + complexProperty.ComplexType, + "complexType", + complexProperty.ClrType, + complexProperty.IsNullable, + QueryTrackingBehavior: null), bindingInfo.MaterializationContextExpression), _ => throw new UnreachableException() diff --git a/test/EFCore.Cosmos.FunctionalTests/Query/AdHocComplexTypeQueryCosmosTest.cs b/test/EFCore.Cosmos.FunctionalTests/Query/AdHocComplexTypeQueryCosmosTest.cs index ec3b98de042..4aaeb064d04 100644 --- a/test/EFCore.Cosmos.FunctionalTests/Query/AdHocComplexTypeQueryCosmosTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/Query/AdHocComplexTypeQueryCosmosTest.cs @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Microsoft.EntityFrameworkCore.Cosmos.Internal; + namespace Microsoft.EntityFrameworkCore.Query; public class AdHocComplexTypeQueryCosmosTest(NonSharedFixture fixture) : AdHocComplexTypeQueryTestBase(fixture) @@ -60,6 +62,16 @@ OFFSET 0 LIMIT 2 """); } + public override async Task Non_optional_complex_type_with_all_nullable_properties_via_left_join() + { + Assert.Equal( + CosmosStrings.UpdateConflict("1"), + (await Assert.ThrowsAsync( + () => base.Non_optional_complex_type_with_all_nullable_properties_via_left_join())).Message); + + AssertSql(); + } + public override async Task Nullable_complex_type_with_discriminator_and_shadow_property() { await base.Nullable_complex_type_with_discriminator_and_shadow_property(); diff --git a/test/EFCore.Specification.Tests/Query/AdHocComplexTypeQueryTestBase.cs b/test/EFCore.Specification.Tests/Query/AdHocComplexTypeQueryTestBase.cs index 36a15190035..b5d5739c8e3 100644 --- a/test/EFCore.Specification.Tests/Query/AdHocComplexTypeQueryTestBase.cs +++ b/test/EFCore.Specification.Tests/Query/AdHocComplexTypeQueryTestBase.cs @@ -239,6 +239,80 @@ public class ComplexTypeWithAllNulls #endregion 37162 + #region 37304 + + [ConditionalFact] + public virtual async Task Non_optional_complex_type_with_all_nullable_properties_via_left_join() + { + var contextFactory = await InitializeNonSharedTest( + seed: context => + { + context.Add( + new Context37304.Parent + { + Id = 1, + Children = + [ + new Context37304.Child + { + Id = 1, + ComplexType = new Context37304.ComplexTypeWithAllNulls() + } + ] + }); + return context.SaveChangesAsync(); + }); + + await using var context = contextFactory.CreateDbContext(); + + var parent = await context.Set().Include(p => p.Children).SingleAsync(); + + var child = parent.Children.Single(); + Assert.NotNull(child.ComplexType); + Assert.Null(child.ComplexType.NullableString); + Assert.Null(child.ComplexType.NullableDateTime); + } + + private class Context37304(DbContextOptions options) : DbContext(options) + { + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.Entity(b => + { + b.Property(p => p.Id).ValueGeneratedNever(); + }); + + modelBuilder.Entity(b => + { + b.Property(c => c.Id).ValueGeneratedNever(); + b.HasOne(c => c.Parent).WithMany(p => p.Children).HasForeignKey(c => c.ParentId); + b.ComplexProperty(c => c.ComplexType); + }); + } + + public class Parent + { + public int Id { get; set; } + public List Children { get; set; } = []; + } + + public class Child + { + public int Id { get; set; } + public int ParentId { get; set; } + public Parent Parent { get; set; } = null!; + public ComplexTypeWithAllNulls ComplexType { get; set; } = null!; + } + + public class ComplexTypeWithAllNulls + { + public string? NullableString { get; set; } + public DateTime? NullableDateTime { get; set; } + } + } + + #endregion 37304 + #region Issue37337 private const string Issue37337CreatedByShadowPropertyName = "CreatedBy";