Skip to content

Commit 76e84e1

Browse files
authored
Sync to EF 11.0.0-preview.3.26155.101 (#3769)
1 parent 9147a7e commit 76e84e1

File tree

56 files changed

+1055
-303
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1055
-303
lines changed

Directory.Packages.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project>
22
<PropertyGroup>
3-
<EFCoreVersion>11.0.0-preview.2.26154.117</EFCoreVersion>
4-
<MicrosoftExtensionsVersion>11.0.0-preview.2.26154.117</MicrosoftExtensionsVersion>
5-
<MicrosoftExtensionsConfigurationVersion>11.0.0-preview.2.26154.117</MicrosoftExtensionsConfigurationVersion>
3+
<EFCoreVersion>11.0.0-preview.3.26155.101</EFCoreVersion>
4+
<MicrosoftExtensionsVersion>11.0.0-preview.3.26155.101</MicrosoftExtensionsVersion>
5+
<MicrosoftExtensionsConfigurationVersion>11.0.0-preview.3.26155.101</MicrosoftExtensionsConfigurationVersion>
66
<NpgsqlVersion>10.0.0</NpgsqlVersion>
77
</PropertyGroup>
88

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ namespace Microsoft.EntityFrameworkCore.BulkUpdates;
22

33
public class NonSharedModelBulkUpdatesNpgsqlTest(NonSharedFixture fixture) : NonSharedModelBulkUpdatesRelationalTestBase(fixture)
44
{
5-
protected override ITestStoreFactory TestStoreFactory
5+
protected override ITestStoreFactory NonSharedTestStoreFactory
66
=> NpgsqlTestStoreFactory.Instance;
77

88

@@ -149,7 +149,7 @@ public override async Task Update_owned_and_non_owned_properties_with_table_shar
149149
public override async Task Update_main_table_in_entity_with_entity_splitting(bool async)
150150
{
151151
// Overridden/duplicated because we update DateTime, which Npgsql requires to be a UTC timestamp
152-
var contextFactory = await InitializeAsync<DbContext>(
152+
var contextFactory = await InitializeNonSharedTest<DbContext>(
153153
onModelCreating: mb => mb.Entity<Blog>()
154154
.ToTable("Blogs")
155155
.SplitToTable(
@@ -166,7 +166,7 @@ public override async Task Update_main_table_in_entity_with_entity_splitting(boo
166166

167167
await AssertUpdate(
168168
async,
169-
contextFactory.CreateContext,
169+
contextFactory.CreateDbContext,
170170
ss => ss.Set<Blog>(),
171171
s => s.SetProperty(b => b.CreationTimestamp, b => new DateTime(2020, 1, 1, 0, 0, 0, DateTimeKind.Utc)),
172172
rowsAffectedCount: 1);
@@ -226,7 +226,7 @@ SELECT COALESCE(sum(o0."Amount"), 0)::int
226226
[MemberData(nameof(IsAsyncData))]
227227
public virtual async Task Update_with_primitive_collection_in_value_selector(bool async)
228228
{
229-
var contextFactory = await InitializeAsync<Context3001>(
229+
var contextFactory = await InitializeNonSharedTest<Context3001>(
230230
seed: async ctx =>
231231
{
232232
ctx.AddRange(new EntityWithPrimitiveCollection { Tags = ["tag1", "tag2"] });
@@ -235,7 +235,7 @@ public virtual async Task Update_with_primitive_collection_in_value_selector(boo
235235

236236
await Assert.ThrowsAsync<InvalidOperationException>(() => AssertUpdate(
237237
async,
238-
contextFactory.CreateContext,
238+
contextFactory.CreateDbContext,
239239
ss => ss.EntitiesWithPrimitiveCollection,
240240
s => s.SetProperty(x => x.Tags, x => x.Tags.Append("another_tag")),
241241
rowsAffectedCount: 1));

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,6 +1697,33 @@ ORDER BY o1."OrderID" NULLS FIRST
16971697
""");
16981698
}
16991699

1700+
public override async Task Update_with_select_mixed_entity_scalar_anonymous_projection(bool async)
1701+
{
1702+
await base.Update_with_select_mixed_entity_scalar_anonymous_projection(async);
1703+
1704+
AssertSql(
1705+
"""
1706+
@p='Updated'
1707+
1708+
UPDATE "Customers" AS c
1709+
SET "ContactName" = @p
1710+
""");
1711+
}
1712+
1713+
public override async Task Update_with_select_scalar_anonymous_projection(bool async)
1714+
{
1715+
await base.Update_with_select_scalar_anonymous_projection(async);
1716+
1717+
AssertSql(
1718+
"""
1719+
@p='Updated'
1720+
1721+
UPDATE "Customers" AS c
1722+
SET "ContactName" = @p
1723+
""");
1724+
}
1725+
1726+
17001727
[ConditionalFact]
17011728
public virtual void Check_all_tests_overridden()
17021729
=> TestHelpers.AssertAllMethodsOverridden(GetType());

test/EFCore.PG.FunctionalTests/EntitySplittingNpgsqlTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ namespace Microsoft.EntityFrameworkCore;
33
public class EntitySplittingNpgsqlTest(NonSharedFixture fixture, ITestOutputHelper testOutputHelper)
44
: EntitySplittingTestBase(fixture, testOutputHelper)
55
{
6-
protected override ITestStoreFactory TestStoreFactory
6+
protected override ITestStoreFactory NonSharedTestStoreFactory
77
=> NpgsqlTestStoreFactory.Instance;
88
}

test/EFCore.PG.FunctionalTests/JsonTypesNpgsqlTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,12 +563,12 @@ protected class LogSequenceNumberType
563563
public NpgsqlLogSequenceNumber LogSequenceNumber { get; set; }
564564
}
565565

566-
protected override ITestStoreFactory TestStoreFactory => NpgsqlTestStoreFactory.Instance;
566+
protected override ITestStoreFactory NonSharedTestStoreFactory => NpgsqlTestStoreFactory.Instance;
567567

568568
protected override IServiceCollection AddServices(IServiceCollection serviceCollection)
569569
=> serviceCollection.AddEntityFrameworkNpgsqlNetTopologySuite();
570570

571-
protected override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder)
571+
protected override DbContextOptionsBuilder AddNonSharedOptions(DbContextOptionsBuilder builder)
572572
{
573573
// Note that the enum doesn't actually need to be created in the database, since Can_read_and_write_JSON_value doesn't access
574574
// the database. We just need the mapping to be picked up by EFCore.PG from the ADO.NET layer.

test/EFCore.PG.FunctionalTests/MaterializationInterceptionNpgsqlTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
1616
}
1717
}
1818

19-
protected override ITestStoreFactory TestStoreFactory
19+
protected override ITestStoreFactory NonSharedTestStoreFactory
2020
=> NpgsqlTestStoreFactory.Instance;
2121
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ namespace Microsoft.EntityFrameworkCore.Query;
33
public class AdHocAdvancedMappingsQueryNpgsqlTest(NonSharedFixture fixture)
44
: AdHocAdvancedMappingsQueryRelationalTestBase(fixture)
55
{
6-
protected override ITestStoreFactory TestStoreFactory
6+
protected override ITestStoreFactory NonSharedTestStoreFactory
77
=> NpgsqlTestStoreFactory.Instance;
88

99
// Cannot write DateTime with Kind=Unspecified to PostgreSQL type 'timestamp with time zone', only UTC is supported.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ LIMIT 2
1919
""");
2020
}
2121

22-
protected override ITestStoreFactory TestStoreFactory
22+
protected override ITestStoreFactory NonSharedTestStoreFactory
2323
=> NpgsqlTestStoreFactory.Instance;
2424
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Microsoft.EntityFrameworkCore.Query;
88

99
public class AdHocJsonQueryNpgsqlTest(NonSharedFixture fixture) : AdHocJsonQueryRelationalTestBase(fixture)
1010
{
11-
protected override ITestStoreFactory TestStoreFactory
11+
protected override ITestStoreFactory NonSharedTestStoreFactory
1212
=> NpgsqlTestStoreFactory.Instance;
1313

1414
protected override async Task Seed29219(DbContext ctx)
@@ -179,7 +179,7 @@ protected override Task SeedBadJsonProperties(ContextBadJsonProperties ctx)
179179
[ConditionalTheory, MemberData(nameof(IsAsyncData))]
180180
public virtual async Task Json_predicate_on_bytea(bool async)
181181
{
182-
var contextFactory = await InitializeAsync<TypesDbContext>(
182+
var contextFactory = await InitializeNonSharedTest<TypesDbContext>(
183183
seed: async context =>
184184
{
185185
context.Entities.AddRange(
@@ -188,7 +188,7 @@ public virtual async Task Json_predicate_on_bytea(bool async)
188188
await context.SaveChangesAsync();
189189
});
190190

191-
using (var context = contextFactory.CreateContext())
191+
using (var context = contextFactory.CreateDbContext())
192192
{
193193
var query = context.Entities.Where(x => x.JsonEntity.Bytea == new byte[] { 1, 2, 4 });
194194

@@ -211,7 +211,7 @@ LIMIT 2
211211
[ConditionalTheory, MemberData(nameof(IsAsyncData))]
212212
public virtual async Task Json_predicate_on_interval(bool async)
213213
{
214-
var contextFactory = await InitializeAsync<TypesDbContext>(
214+
var contextFactory = await InitializeNonSharedTest<TypesDbContext>(
215215
seed: async context =>
216216
{
217217
context.Entities.AddRange(
@@ -220,7 +220,7 @@ public virtual async Task Json_predicate_on_interval(bool async)
220220
await context.SaveChangesAsync();
221221
});
222222

223-
using (var context = contextFactory.CreateContext())
223+
using (var context = contextFactory.CreateDbContext())
224224
{
225225
var query = context.Entities.Where(x => x.JsonEntity.Interval == new TimeSpan(2, 2, 3, 4, 123, 456));
226226

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ namespace Microsoft.EntityFrameworkCore.Query;
22

33
public class AdHocManyToManyQueryNpgsqlTest(NonSharedFixture fixture) : AdHocManyToManyQueryRelationalTestBase(fixture)
44
{
5-
protected override ITestStoreFactory TestStoreFactory
5+
protected override ITestStoreFactory NonSharedTestStoreFactory
66
=> NpgsqlTestStoreFactory.Instance;
77
}

0 commit comments

Comments
 (0)