Skip to content

Commit 85cd0aa

Browse files
authored
Sync to EF 10.0.0-preview.2.25103.6 (#3454)
1 parent 352306a commit 85cd0aa

File tree

8 files changed

+227
-139
lines changed

8 files changed

+227
-139
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
pull_request:
1212

1313
env:
14-
dotnet_sdk_version: '10.0.100-alpha.1.25059.31'
14+
dotnet_sdk_version: '10.0.100-preview.2.25081.1'
1515
postgis_version: 3
1616
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
1717

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ on:
2727
- cron: '30 22 * * 6'
2828

2929
env:
30-
dotnet_sdk_version: '10.0.100-alpha.1.25059.31'
30+
dotnet_sdk_version: '10.0.100-preview.2.25081.1'
3131

3232
jobs:
3333
analyze:

Directory.Packages.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<PropertyGroup>
3-
<EFCoreVersion>10.0.0-preview.1.25077.1</EFCoreVersion>
4-
<MicrosoftExtensionsVersion>10.0.0-alpha.1.25073.13</MicrosoftExtensionsVersion>
3+
<EFCoreVersion>10.0.0-preview.2.25103.6</EFCoreVersion>
4+
<MicrosoftExtensionsVersion>10.0.0-preview.2.25102.2</MicrosoftExtensionsVersion>
55
<NpgsqlVersion>9.0.2</NpgsqlVersion>
66
</PropertyGroup>
77

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "10.0.100-alpha.1.25059.31",
3+
"version": "10.0.100-preview.2.25081.1",
44
"rollForward": "latestMajor",
55
"allowPrerelease": true
66
}

test/EFCore.PG.FunctionalTests/BulkUpdates/NorthwindBulkUpdatesNpgsqlTest.cs

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Microsoft.EntityFrameworkCore.BulkUpdates;
44

5+
#nullable disable
6+
57
public class NorthwindBulkUpdatesNpgsqlTest(
68
NorthwindBulkUpdatesNpgsqlFixture<NoopModelCustomizer> fixture,
79
ITestOutputHelper testOutputHelper)
@@ -619,6 +621,30 @@ LIMIT 100 OFFSET 0
619621
""");
620622
}
621623

624+
public override async Task Delete_with_RightJoin(bool async)
625+
{
626+
await base.Delete_with_RightJoin(async);
627+
628+
AssertSql(
629+
"""
630+
@p0='100'
631+
@p='0'
632+
633+
DELETE FROM "Order Details" AS o
634+
WHERE EXISTS (
635+
SELECT 1
636+
FROM "Order Details" AS o0
637+
RIGHT JOIN (
638+
SELECT o2."OrderID"
639+
FROM "Orders" AS o2
640+
WHERE o2."OrderID" < 10300
641+
ORDER BY o2."OrderID" NULLS FIRST
642+
LIMIT @p0 OFFSET @p
643+
) AS o1 ON o0."OrderID" = o1."OrderID"
644+
WHERE o0."OrderID" < 10276 AND o0."OrderID" = o."OrderID" AND o0."ProductID" = o."ProductID")
645+
""");
646+
}
647+
622648
public override async Task Update_Where_set_constant_TagWith(bool async)
623649
{
624650
await base.Update_Where_set_constant_TagWith(async);
@@ -1287,6 +1313,41 @@ WHERE c."CustomerID" LIKE 'F%'
12871313
""");
12881314
}
12891315

1316+
public override async Task Update_with_RightJoin(bool async)
1317+
{
1318+
await AssertUpdate(
1319+
async,
1320+
ss => ss.Set<Order>().Where(o => o.OrderID < 10300)
1321+
.RightJoin(
1322+
ss.Set<Customer>().Where(c => c.CustomerID.StartsWith("F")),
1323+
o => o.CustomerID,
1324+
c => c.CustomerID,
1325+
(o, c) => new { Order = o, Customers = c }),
1326+
e => e.Order,
1327+
s => s.SetProperty(t => t.Order.OrderDate, new DateTime(2020, 1, 1, 0, 0, 0)),
1328+
rowsAffectedCount: 2,
1329+
(b, a) => Assert.All(a, o => Assert.Equal(new DateTime(2020, 1, 1, 0, 0, 0), o.OrderDate)));
1330+
1331+
AssertExecuteUpdateSql(
1332+
"""
1333+
@p='2020-01-01T00:00:00.0000000' (Nullable = true)
1334+
1335+
UPDATE "Orders" AS o0
1336+
SET "OrderDate" = @p
1337+
FROM (
1338+
SELECT o."OrderID"
1339+
FROM "Orders" AS o
1340+
RIGHT JOIN (
1341+
SELECT c."CustomerID"
1342+
FROM "Customers" AS c
1343+
WHERE c."CustomerID" LIKE 'F%'
1344+
) AS c0 ON o."CustomerID" = c0."CustomerID"
1345+
WHERE o."OrderID" < 10300
1346+
) AS s
1347+
WHERE o0."OrderID" = s."OrderID"
1348+
""");
1349+
}
1350+
12901351
public override async Task Update_with_cross_join_set_constant(bool async)
12911352
{
12921353
await base.Update_with_cross_join_set_constant(async);

test/EFCore.PG.FunctionalTests/Query/JsonQueryNpgsqlTest.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,9 +606,9 @@ public override async Task Project_entity_with_single_owned(bool async)
606606
""");
607607
}
608608

609-
public override async Task Left_join_json_entities(bool async)
609+
public override async Task LeftJoin_json_entities(bool async)
610610
{
611-
await base.Left_join_json_entities(async);
611+
await base.LeftJoin_json_entities(async);
612612

613613
AssertSql(
614614
"""
@@ -618,6 +618,18 @@ public override async Task Left_join_json_entities(bool async)
618618
""");
619619
}
620620

621+
public override async Task RightJoin_json_entities(bool async)
622+
{
623+
await base.RightJoin_json_entities(async);
624+
625+
AssertSql(
626+
"""
627+
SELECT j."Id", j."EntityBasicId", j."Name", j."OwnedCollectionRoot", j."OwnedReferenceRoot", j0."Id", j0."Name", j0."OwnedCollection"
628+
FROM "JsonEntitiesBasic" AS j
629+
RIGHT JOIN "JsonEntitiesSingleOwned" AS j0 ON j."Id" = j0."Id"
630+
""");
631+
}
632+
621633
public override async Task Left_join_json_entities_complex_projection(bool async)
622634
{
623635
await base.Left_join_json_entities_complex_projection(async);

test/EFCore.PG.FunctionalTests/Query/NorthwindAggregateOperatorsQueryNpgsqlTest.cs

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -67,36 +67,39 @@ public override async Task Contains_with_local_uint_array_closure(bool async)
6767
""");
6868
}
6969

70-
public override async Task Contains_with_local_nullable_uint_array_closure(bool async)
71-
{
72-
await base.Contains_with_local_nullable_uint_array_closure(async);
73-
74-
// Note: PostgreSQL doesn't support uint, but value converters make this into bigint
75-
76-
AssertSql(
77-
"""
78-
@ids={ '0', '1' } (DbType = Object)
79-
80-
SELECT e."EmployeeID", e."City", e."Country", e."FirstName", e."ReportsTo", e."Title"
81-
FROM "Employees" AS e
82-
WHERE e."EmployeeID" = ANY (@ids)
83-
""",
84-
//
85-
"""
86-
@ids={ '0' } (DbType = Object)
87-
88-
SELECT e."EmployeeID", e."City", e."Country", e."FirstName", e."ReportsTo", e."Title"
89-
FROM "Employees" AS e
90-
WHERE e."EmployeeID" = ANY (@ids)
91-
""");
92-
}
93-
94-
public override Task Contains_with_local_anonymous_type_array_closure(bool async)
95-
// Aggregates. Issue #15937.
96-
=> AssertTranslationFailed(() => base.Contains_with_local_anonymous_type_array_closure(async));
97-
98-
public override Task Contains_with_local_tuple_array_closure(bool async)
99-
=> Assert.ThrowsAsync<InvalidCastException>(() => base.Contains_with_local_tuple_array_closure(async: true));
70+
// TODO: The base implementations no longer compile since https://github.com/dotnet/runtime/pull/110197 (Contains overload added with
71+
// optional parameter, not supported in expression trees). #35547 is tracking on the EF side.
72+
//
73+
// public override async Task Contains_with_local_nullable_uint_array_closure(bool async)
74+
// {
75+
// await base.Contains_with_local_nullable_uint_array_closure(async);
76+
//
77+
// // Note: PostgreSQL doesn't support uint, but value converters make this into bigint
78+
//
79+
// AssertSql(
80+
// """
81+
// @ids={ '0', '1' } (DbType = Object)
82+
//
83+
// SELECT e."EmployeeID", e."City", e."Country", e."FirstName", e."ReportsTo", e."Title"
84+
// FROM "Employees" AS e
85+
// WHERE e."EmployeeID" = ANY (@ids)
86+
// """,
87+
// //
88+
// """
89+
// @ids={ '0' } (DbType = Object)
90+
//
91+
// SELECT e."EmployeeID", e."City", e."Country", e."FirstName", e."ReportsTo", e."Title"
92+
// FROM "Employees" AS e
93+
// WHERE e."EmployeeID" = ANY (@ids)
94+
// """);
95+
// }
96+
//
97+
// public override Task Contains_with_local_anonymous_type_array_closure(bool async)
98+
// // Aggregates. Issue #15937.
99+
// => AssertTranslationFailed(() => base.Contains_with_local_anonymous_type_array_closure(async));
100+
//
101+
// public override Task Contains_with_local_tuple_array_closure(bool async)
102+
// => Assert.ThrowsAsync<InvalidCastException>(() => base.Contains_with_local_tuple_array_closure(async: true));
100103

101104
public override async Task Contains_with_local_enumerable_inline(bool async)
102105
{

0 commit comments

Comments
 (0)