Skip to content

Commit d08003c

Browse files
authored
[automated] Merge branch 'release/10.0' => 'main' (#37945)
2 parents f9393e7 + 29ecbe0 commit d08003c

6 files changed

Lines changed: 94 additions & 4 deletions

File tree

eng/Version.Details.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ This file should be imported by eng/Versions.props
2727
</PropertyGroup>
2828
<!--Property group for alternate package version names-->
2929
<PropertyGroup>
30-
<!-- dotnet/dotnet dependencies -->
30+
<!-- dotnet-dotnet dependencies -->
3131
<MicrosoftDotNetArcadeSdkVersion>$(MicrosoftDotNetArcadeSdkPackageVersion)</MicrosoftDotNetArcadeSdkVersion>
3232
<MicrosoftDotNetBuildTasksTemplatingVersion>$(MicrosoftDotNetBuildTasksTemplatingPackageVersion)</MicrosoftDotNetBuildTasksTemplatingVersion>
3333
<MicrosoftDotNetHelixSdkVersion>$(MicrosoftDotNetHelixSdkPackageVersion)</MicrosoftDotNetHelixSdkVersion>

eng/common/core-templates/steps/publish-logs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ steps:
3131
-runtimeSourceFeed https://ci.dot.net/internal
3232
-runtimeSourceFeedKey '$(dotnetbuilds-internal-container-read-token-base64)'
3333
'$(publishing-dnceng-devdiv-code-r-build-re)'
34-
'$(MaestroAccessToken)'
3534
'$(dn-bot-all-orgs-artifact-feeds-rw)'
3635
'$(akams-client-id)'
3736
'$(microsoft-symbol-server-pat)'

eng/common/templates/post-build/post-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ stages:
55
is1ESPipeline: false
66

77
${{ each parameter in parameters }}:
8-
${{ parameter.key }}: ${{ parameter.value }}
8+
${{ parameter.key }}: ${{ parameter.value }}

src/EFCore/Query/Internal/StructuralTypeMaterializerSource.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,12 @@ IServiceProperty serviceProperty
204204

205205
IComplexProperty complexProperty
206206
=> CreateMaterializeExpression(
207-
new StructuralTypeMaterializerSourceParameters(complexProperty.ComplexType, "complexType", complexProperty.ClrType, nullable || complexProperty.IsNullable, QueryTrackingBehavior: null),
207+
new StructuralTypeMaterializerSourceParameters(
208+
complexProperty.ComplexType,
209+
"complexType",
210+
complexProperty.ClrType,
211+
complexProperty.IsNullable,
212+
QueryTrackingBehavior: null),
208213
bindingInfo.MaterializationContextExpression),
209214

210215
_ => throw new UnreachableException()

test/EFCore.Cosmos.FunctionalTests/Query/AdHocComplexTypeQueryCosmosTest.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
using Microsoft.EntityFrameworkCore.Cosmos.Internal;
5+
46
namespace Microsoft.EntityFrameworkCore.Query;
57

68
public class AdHocComplexTypeQueryCosmosTest(NonSharedFixture fixture) : AdHocComplexTypeQueryTestBase(fixture)
@@ -60,6 +62,16 @@ OFFSET 0 LIMIT 2
6062
""");
6163
}
6264

65+
public override async Task Non_optional_complex_type_with_all_nullable_properties_via_left_join()
66+
{
67+
Assert.Equal(
68+
CosmosStrings.UpdateConflict("1"),
69+
(await Assert.ThrowsAsync<DbUpdateException>(
70+
() => base.Non_optional_complex_type_with_all_nullable_properties_via_left_join())).Message);
71+
72+
AssertSql();
73+
}
74+
6375
public override async Task Nullable_complex_type_with_discriminator_and_shadow_property()
6476
{
6577
await base.Nullable_complex_type_with_discriminator_and_shadow_property();

test/EFCore.Specification.Tests/Query/AdHocComplexTypeQueryTestBase.cs

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,80 @@ public class ComplexTypeWithAllNulls
239239

240240
#endregion 37162
241241

242+
#region 37304
243+
244+
[ConditionalFact]
245+
public virtual async Task Non_optional_complex_type_with_all_nullable_properties_via_left_join()
246+
{
247+
var contextFactory = await InitializeNonSharedTest<Context37304>(
248+
seed: context =>
249+
{
250+
context.Add(
251+
new Context37304.Parent
252+
{
253+
Id = 1,
254+
Children =
255+
[
256+
new Context37304.Child
257+
{
258+
Id = 1,
259+
ComplexType = new Context37304.ComplexTypeWithAllNulls()
260+
}
261+
]
262+
});
263+
return context.SaveChangesAsync();
264+
});
265+
266+
await using var context = contextFactory.CreateDbContext();
267+
268+
var parent = await context.Set<Context37304.Parent>().Include(p => p.Children).SingleAsync();
269+
270+
var child = parent.Children.Single();
271+
Assert.NotNull(child.ComplexType);
272+
Assert.Null(child.ComplexType.NullableString);
273+
Assert.Null(child.ComplexType.NullableDateTime);
274+
}
275+
276+
private class Context37304(DbContextOptions options) : DbContext(options)
277+
{
278+
protected override void OnModelCreating(ModelBuilder modelBuilder)
279+
{
280+
modelBuilder.Entity<Parent>(b =>
281+
{
282+
b.Property(p => p.Id).ValueGeneratedNever();
283+
});
284+
285+
modelBuilder.Entity<Child>(b =>
286+
{
287+
b.Property(c => c.Id).ValueGeneratedNever();
288+
b.HasOne(c => c.Parent).WithMany(p => p.Children).HasForeignKey(c => c.ParentId);
289+
b.ComplexProperty(c => c.ComplexType);
290+
});
291+
}
292+
293+
public class Parent
294+
{
295+
public int Id { get; set; }
296+
public List<Child> Children { get; set; } = [];
297+
}
298+
299+
public class Child
300+
{
301+
public int Id { get; set; }
302+
public int ParentId { get; set; }
303+
public Parent Parent { get; set; } = null!;
304+
public ComplexTypeWithAllNulls ComplexType { get; set; } = null!;
305+
}
306+
307+
public class ComplexTypeWithAllNulls
308+
{
309+
public string? NullableString { get; set; }
310+
public DateTime? NullableDateTime { get; set; }
311+
}
312+
}
313+
314+
#endregion 37304
315+
242316
#region Issue37337
243317

244318
private const string Issue37337CreatedByShadowPropertyName = "CreatedBy";

0 commit comments

Comments
 (0)