diff --git a/src/EFCore/ChangeTracking/Internal/KeyPropagator.cs b/src/EFCore/ChangeTracking/Internal/KeyPropagator.cs index 211b55136a8..15c27725391 100644 --- a/src/EFCore/ChangeTracking/Internal/KeyPropagator.cs +++ b/src/EFCore/ChangeTracking/Internal/KeyPropagator.cs @@ -77,7 +77,8 @@ public KeyPropagator( var principalEntry = TryPropagateValue(entry, property, generationProperty); if (principalEntry == null - && property.IsKey()) + && property.IsKey() + && !property.IsForeignKeyToSelf()) { var valueGenerator = TryGetValueGenerator( generationProperty, diff --git a/test/EFCore.Cosmos.FunctionalTests/ConfigPatternsCosmosTest.cs b/test/EFCore.Cosmos.FunctionalTests/ConfigPatternsCosmosTest.cs index 955a6bad082..daaa5d8b6fb 100644 --- a/test/EFCore.Cosmos.FunctionalTests/ConfigPatternsCosmosTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/ConfigPatternsCosmosTest.cs @@ -59,9 +59,9 @@ public async Task Should_not_throw_if_specified_region_is_right() using var context = new CustomerContext(options); context.Database.EnsureCreated(); - context.Add(customer); + await context.AddAsync(customer); - context.SaveChanges(); + await context.SaveChangesAsync(); } [ConditionalFact] @@ -78,9 +78,9 @@ public async Task Should_throw_if_specified_region_is_wrong() using var context = new CustomerContext(options); context.Database.EnsureCreated(); - context.Add(customer); + await context.AddAsync(customer); - context.SaveChanges(); + await context.SaveChangesAsync(); }); Assert.Equal( @@ -101,9 +101,9 @@ public async Task Should_not_throw_if_specified_connection_mode_is_right() using var context = new CustomerContext(options); context.Database.EnsureCreated(); - context.Add(customer); + await context.AddAsync(customer); - context.SaveChanges(); + await context.SaveChangesAsync(); } [ConditionalFact] @@ -121,9 +121,9 @@ public async Task Should_throw_if_specified_connection_mode_is_wrong() using var context = new CustomerContext(options); context.Database.EnsureCreated(); - context.Add(customer); + await context.AddAsync(customer); - context.SaveChanges(); + await context.SaveChangesAsync(); }); } diff --git a/test/EFCore.Cosmos.FunctionalTests/CosmosConcurrencyTest.cs b/test/EFCore.Cosmos.FunctionalTests/CosmosConcurrencyTest.cs index b414f9550b1..d4a68960e32 100644 --- a/test/EFCore.Cosmos.FunctionalTests/CosmosConcurrencyTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/CosmosConcurrencyTest.cs @@ -61,7 +61,7 @@ public async Task Etag_will_return_when_content_response_enabled_false() { await context.Database.EnsureCreatedAsync(); - context.Add(customer); + await context.AddAsync(customer); await context.SaveChangesAsync(); } @@ -96,7 +96,7 @@ public async Task Etag_will_return_when_content_response_enabled_true() { await context.Database.EnsureCreatedAsync(); - context.Add(customer); + await context.AddAsync(customer); await context.SaveChangesAsync(); } @@ -144,7 +144,7 @@ public async Task Etag_is_updated_in_entity_after_SaveChanges(bool? contentRespo { await context.Database.EnsureCreatedAsync(); - context.Add(customer); + await context.AddAsync(customer); await context.SaveChangesAsync(); diff --git a/test/EFCore.Cosmos.FunctionalTests/EmbeddedDocumentsTest.cs b/test/EFCore.Cosmos.FunctionalTests/EmbeddedDocumentsTest.cs index 0f9ad72c161..97682a1fec4 100644 --- a/test/EFCore.Cosmos.FunctionalTests/EmbeddedDocumentsTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/EmbeddedDocumentsTest.cs @@ -83,7 +83,7 @@ public virtual async Task Can_attach_owner_with_dependents() using (var context = new EmbeddedTransportationContext(options)) { //Issue #15289 - var firstVehicleEntry = context.Add(firstVehicle); + var firstVehicleEntry = await context.AddAsync(firstVehicle); firstVehicleEntry.State = EntityState.Unchanged; firstVehicle.Operator.Name += "1"; @@ -112,7 +112,7 @@ public virtual async Task Can_manipulate_embedded_collections(bool useIds) Address addedAddress3; using (var context = new EmbeddedTransportationContext(options)) { - context.Add(new Person { Id = 1 }); + await context.AddAsync(new Person { Id = 1 }); existingAddress1Person2 = new Address { Street = "Second", @@ -140,7 +140,7 @@ public virtual async Task Can_manipulate_embedded_collections(bool useIds) Street = "First", City = "Village" }; - context.Add(new Person { Id = 2, Addresses = new List
{ existingAddress1Person2, existingAddress2Person2 } }); + await context.AddAsync(new Person { Id = 2, Addresses = new List
{ existingAddress1Person2, existingAddress2Person2 } }); existingAddress1Person3 = new Address { Street = "First", @@ -169,7 +169,7 @@ public virtual async Task Can_manipulate_embedded_collections(bool useIds) AddressTitle = new AddressTitle { Title = "P3 Billing" } }; - context.Add(new Person { Id = 3, Addresses = new List
{ existingAddress1Person3, existingAddress2Person3 } }); + await context.AddAsync(new Person { Id = 3, Addresses = new List
{ existingAddress1Person3, existingAddress2Person3 } }); await context.SaveChangesAsync(); @@ -407,7 +407,7 @@ public virtual async Task Properties_on_owned_types_can_be_client_generated() AddressTitle = new AddressTitle() }; - context.Add(new Person { Id = 1, Addresses = new List
{ address } }); + await context.AddAsync(new Person { Id = 1, Addresses = new List
{ address } }); Assert.Equal("DefaultTitle", address.AddressTitle.Title); await context.SaveChangesAsync(); @@ -441,7 +441,7 @@ public virtual async Task Can_use_non_int_keys_for_embedded_entities() var person = new Person { Id = 1 }; address = new Address { Street = "Second", City = "Village" }; person.Addresses.Add(address); - context.Add(person); + await context.AddAsync(person); var addressEntry = context.Entry(address); addressGuid = (Guid)addressEntry.Property("Id").CurrentValue; @@ -505,7 +505,7 @@ public virtual async Task Can_query_just_embedded_collection() using (var context = new EmbeddedTransportationContext(options)) { - context.Add( + await context.AddAsync( new Person { Id = 3, @@ -531,7 +531,7 @@ public virtual async Task Inserting_dependent_without_principal_throws() { var options = Fixture.CreateOptions(seed: false); using var context = new EmbeddedTransportationContext(options); - context.Add( + await context.AddAsync( new LicensedOperator { Name = "Jack Jackson", @@ -586,7 +586,7 @@ public virtual async Task Can_change_principal_instance_non_derived() }; context.Remove(bike); - context.Add(newBike); + await context.AddAsync(newBike); TestSqlLoggerFactory.Clear(); await context.SaveChangesAsync(); diff --git a/test/EFCore.Cosmos.FunctionalTests/EndToEndCosmosTest.cs b/test/EFCore.Cosmos.FunctionalTests/EndToEndCosmosTest.cs index 8b3b68d84c2..fb8e4c85c64 100644 --- a/test/EFCore.Cosmos.FunctionalTests/EndToEndCosmosTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/EndToEndCosmosTest.cs @@ -102,7 +102,7 @@ public async Task Can_add_update_delete_end_to_end_async() { await context.Database.EnsureCreatedAsync(); - context.Add(customer); + await context.AddAsync(customer); await context.SaveChangesAsync(); @@ -170,11 +170,11 @@ public async Task Can_add_update_delete_detached_entity_end_to_end_async() { await context.Database.EnsureCreatedAsync(); - var entry = context.Add(customer); + var entry = await context.AddAsync(customer); await context.SaveChangesAsync(); - context.Add(customer); + await context.AddAsync(customer); storeId = entry.Property(StoreKeyConvention.DefaultIdPropertyName).CurrentValue; } @@ -319,7 +319,7 @@ public async Task Can_add_update_untracked_properties_async() { await context.Database.EnsureCreatedAsync(); - var entry = context.Add(customer); + var entry = await context.AddAsync(customer); await context.SaveChangesAsync(); @@ -336,7 +336,7 @@ public async Task Can_add_update_untracked_properties_async() { Assert.Empty(await context.Set().ToListAsync()); - var entry = context.Add(customer); + var entry = await context.AddAsync(customer); entry.Property("__jObject").CurrentValue = new JObject { ["key1"] = "value1" }; @@ -408,7 +408,7 @@ public async Task Can_add_update_delete_end_to_end_with_Guid_async() { await context.Database.EnsureCreatedAsync(); - context.Add(customer); + await context.AddAsync(customer); await context.SaveChangesAsync(); } @@ -459,7 +459,7 @@ public async Task Can_add_update_delete_end_to_end_with_DateTime_async() { await context.Database.EnsureCreatedAsync(); - var entry = context.Add(customer); + var entry = await context.AddAsync(customer); Assert.Equal("CustomerDateTime|0001-01-01T00:00:00.0000000|Theon^2F^5C^23^5C^5C^3F", entry.CurrentValues["__id"]); @@ -588,7 +588,7 @@ public async Task Can_add_update_delete_with_dateTime_string_end_to_end_async() { await context.Database.EnsureCreatedAsync(); - context.Add(customer); + await context.AddAsync(customer); await context.SaveChangesAsync(); } @@ -828,7 +828,7 @@ private async Task Can_add_update_delete_with_collection( { await context.Database.EnsureCreatedAsync(); - context.Add(customer); + await context.AddAsync(customer); await context.SaveChangesAsync(); } @@ -911,8 +911,8 @@ public async Task Can_read_with_find_with_resource_id_async() context.Model.FindEntityType(typeof(CustomerWithResourceId)) .FindProperty(StoreKeyConvention.DefaultIdPropertyName)); - context.Add(customer); - context.Add( + await context.AddAsync(customer); + await context.AddAsync( new CustomerWithResourceId { id = "42", @@ -1039,8 +1039,8 @@ public async Task Can_read_with_find_with_partition_key_and_value_generator_asyn { await context.Database.EnsureCreatedAsync(); - context.Add(customer); - context.Add( + await context.AddAsync(customer); + await context.AddAsync( new Customer { Id = 42, @@ -1207,7 +1207,7 @@ public async Task Can_read_with_find_with_partition_key_not_part_of_primary_key( { await context.Database.EnsureCreatedAsync(); - context.Add(customer); + await context.AddAsync(customer); await context.SaveChangesAsync(); } @@ -1233,7 +1233,7 @@ public async Task Can_read_with_find_without_partition_key() { await context.Database.EnsureCreatedAsync(); - context.Add(customer); + await context.AddAsync(customer); await context.SaveChangesAsync(); } @@ -1259,7 +1259,7 @@ public async Task Can_read_with_find_with_PK_partition_key() { await context.Database.EnsureCreatedAsync(); - context.Add(customer); + await context.AddAsync(customer); await context.SaveChangesAsync(); } @@ -1285,7 +1285,7 @@ public async Task Can_read_with_find_with_PK_resource_id() { await context.Database.EnsureCreatedAsync(); - context.Add(customer); + await context.AddAsync(customer); await context.SaveChangesAsync(); } @@ -1449,14 +1449,14 @@ public async Task Can_use_detached_entities_without_discriminators() { await context.Database.EnsureCreatedAsync(); - context.Add(customer); + await context.AddAsync(customer); await context.SaveChangesAsync(); } using (var context = new NoDiscriminatorCustomerContext(options)) { - context.Add(customer).State = EntityState.Modified; + (await context.AddAsync(customer)).State = EntityState.Modified; customer.Name = "Theon Greyjoy"; @@ -1470,7 +1470,7 @@ public async Task Can_use_detached_entities_without_discriminators() Assert.Equal(42, customerFromStore.Id); Assert.Equal("Theon Greyjoy", customerFromStore.Name); - context.Add(customer).State = EntityState.Deleted; + (await context.AddAsync(customer)).State = EntityState.Deleted; await context.SaveChangesAsync(); } @@ -1570,7 +1570,7 @@ public async Task Can_use_non_persisted_properties() { await context.Database.EnsureCreatedAsync(); - context.Add(customer); + await context.AddAsync(customer); await context.SaveChangesAsync(); Assert.Equal("Theon", customer.Name); @@ -1609,7 +1609,7 @@ public async Task Add_update_delete_query_throws_if_no_container() var customer = new Customer { Id = 42, Name = "Theon" }; using (var context = new CustomerContext(options)) { - context.Add(customer); + await context.AddAsync(customer); Assert.StartsWith( "Response status code does not indicate success: NotFound (404); Substatus: 0", @@ -1618,7 +1618,7 @@ public async Task Add_update_delete_query_throws_if_no_container() using (var context = new CustomerContext(options)) { - context.Add(customer).State = EntityState.Modified; + (await context.AddAsync(customer)).State = EntityState.Modified; Assert.StartsWith( "Response status code does not indicate success: NotFound (404); Substatus: 0", @@ -1627,7 +1627,7 @@ public async Task Add_update_delete_query_throws_if_no_container() using (var context = new CustomerContext(options)) { - context.Add(customer).State = EntityState.Deleted; + (await context.AddAsync(customer)).State = EntityState.Deleted; Assert.StartsWith( "Response status code does not indicate success: NotFound (404); Substatus: 0", @@ -1653,7 +1653,7 @@ await Assert.ThrowsAnyAsync( { await context.Database.EnsureCreatedAsync(); - context.Add(new ConflictingIncompatibleId { id = 42 }); + await context.AddAsync(new ConflictingIncompatibleId { id = 42 }); await context.SaveChangesAsync(); }); @@ -1688,7 +1688,7 @@ public async Task Can_add_update_delete_end_to_end_with_conflicting_id() { await context.Database.EnsureCreatedAsync(); - context.Add(entity); + await context.AddAsync(entity); await context.SaveChangesAsync(); } @@ -1754,7 +1754,7 @@ public async Task Can_have_non_string_property_named_Discriminator() using var context = new NonStringDiscriminatorContext(Fixture.CreateOptions()); context.Database.EnsureCreated(); - context.Add(new NonStringDiscriminator { Id = 1 }); + await context.AddAsync(new NonStringDiscriminator { Id = 1 }); await context.SaveChangesAsync(); Assert.NotNull(await context.Set().OrderBy(e => e.Id).FirstOrDefaultAsync()); diff --git a/test/EFCore.Cosmos.FunctionalTests/Internal/IdentifierShadowValuePresenceTest.cs b/test/EFCore.Cosmos.FunctionalTests/Internal/IdentifierShadowValuePresenceTest.cs index 9dde780dc18..972e90451af 100644 --- a/test/EFCore.Cosmos.FunctionalTests/Internal/IdentifierShadowValuePresenceTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/Internal/IdentifierShadowValuePresenceTest.cs @@ -15,7 +15,7 @@ public async Task Entities_with_null_PK_can_be_added_with_normal_use_of_DbContex Assert.Null(item.Id); - var entry = context.Add(item); + var entry = await context.AddAsync(item); var id = entry.Property("__id").CurrentValue; diff --git a/test/EFCore.Cosmos.FunctionalTests/ReloadTest.cs b/test/EFCore.Cosmos.FunctionalTests/ReloadTest.cs index 1739b5078ca..979285470c1 100644 --- a/test/EFCore.Cosmos.FunctionalTests/ReloadTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/ReloadTest.cs @@ -18,7 +18,7 @@ public async Task Entity_reference_can_be_reloaded(bool async) using var context = new ReloadTestContext(testDatabase); await context.Database.EnsureCreatedAsync(); - var entry = context.Add(new Item { Id = 1337 }); + var entry = await context.AddAsync(new Item { Id = 1337 }); await context.SaveChangesAsync(); diff --git a/test/EFCore.InMemory.FunctionalTests/CompositeKeyEndToEndTest.cs b/test/EFCore.InMemory.FunctionalTests/CompositeKeyEndToEndTest.cs index c7631d347bf..f4d2ffa9cd9 100644 --- a/test/EFCore.InMemory.FunctionalTests/CompositeKeyEndToEndTest.cs +++ b/test/EFCore.InMemory.FunctionalTests/CompositeKeyEndToEndTest.cs @@ -18,7 +18,7 @@ public async Task Can_use_two_non_generated_integers_as_composite_key_end_to_end using (var context = new BronieContext(serviceProvider)) { - context.Add( + await context.AddAsync( new Pegasus { Id1 = ticks, @@ -67,8 +67,8 @@ public async Task Can_use_generated_values_in_composite_key_end_to_end() using (var context = new BronieContext(serviceProvider)) { - var added = context.Add( - new Unicorn { Id2 = id2, Name = "Rarity" }).Entity; + var added = (await context.AddAsync( + new Unicorn { Id2 = id2, Name = "Rarity" })).Entity; Assert.True(added.Id1 > 0); Assert.NotEqual(Guid.Empty, added.Id3); @@ -121,12 +121,12 @@ public async Task Only_one_part_of_a_composite_key_needs_to_vary_for_uniqueness( using (var context = new BronieContext(serviceProvider)) { - var pony1 = context.Add( - new EarthPony { Id2 = 7, Name = "Apple Jack 1" }).Entity; - var pony2 = context.Add( - new EarthPony { Id2 = 7, Name = "Apple Jack 2" }).Entity; - var pony3 = context.Add( - new EarthPony { Id2 = 7, Name = "Apple Jack 3" }).Entity; + var pony1 = (await context.AddAsync( + new EarthPony { Id2 = 7, Name = "Apple Jack 1" })).Entity; + var pony2 = (await context.AddAsync( + new EarthPony { Id2 = 7, Name = "Apple Jack 2" })).Entity; + var pony3 = (await context.AddAsync( + new EarthPony { Id2 = 7, Name = "Apple Jack 3" })).Entity; await context.SaveChangesAsync(); diff --git a/test/EFCore.InMemory.FunctionalTests/DatabaseInMemoryTest.cs b/test/EFCore.InMemory.FunctionalTests/DatabaseInMemoryTest.cs index c0e2edfa20e..6ae37c03e72 100644 --- a/test/EFCore.InMemory.FunctionalTests/DatabaseInMemoryTest.cs +++ b/test/EFCore.InMemory.FunctionalTests/DatabaseInMemoryTest.cs @@ -34,7 +34,7 @@ public async Task Can_add_update_delete_end_to_end() using (var context = new DbContext(options)) { - context.Add(customer); + await context.AddAsync(customer); await context.SaveChangesAsync(); diff --git a/test/EFCore.InMemory.FunctionalTests/GuidValueGeneratorEndToEndTest.cs b/test/EFCore.InMemory.FunctionalTests/GuidValueGeneratorEndToEndTest.cs index 780bb743b31..7606f724c75 100644 --- a/test/EFCore.InMemory.FunctionalTests/GuidValueGeneratorEndToEndTest.cs +++ b/test/EFCore.InMemory.FunctionalTests/GuidValueGeneratorEndToEndTest.cs @@ -19,8 +19,8 @@ public async Task Can_use_GUIDs_end_to_end_async() for (var i = 0; i < 10; i++) { guids.Add( - context.Add( - new Pegasus { Name = "Rainbow Dash " + i }).Entity.Id); + (await context.AddAsync( + new Pegasus { Name = "Rainbow Dash " + i })).Entity.Id); guidsHash.Add(guids.Last()); } diff --git a/test/EFCore.InMemory.FunctionalTests/IntegerGeneratorEndToEndInMemoryTest.cs b/test/EFCore.InMemory.FunctionalTests/IntegerGeneratorEndToEndInMemoryTest.cs index 291e25c6aa8..a7639773a9f 100644 --- a/test/EFCore.InMemory.FunctionalTests/IntegerGeneratorEndToEndInMemoryTest.cs +++ b/test/EFCore.InMemory.FunctionalTests/IntegerGeneratorEndToEndInMemoryTest.cs @@ -66,9 +66,9 @@ private static async Task AddEntitiesAsync(IServiceProvider serviceProvider) using var context = new BronieContext(serviceProvider); for (var i = 0; i < 50; i++) { - context.Add( + await context.AddAsync( new Pegasus { Name = "Rainbow Dash " + i }); - context.Add( + await context.AddAsync( new Pegasus { Name = "Fluttershy " + i }); } diff --git a/test/EFCore.InMemory.FunctionalTests/ShadowStateUpdateTest.cs b/test/EFCore.InMemory.FunctionalTests/ShadowStateUpdateTest.cs index d033f5def37..08f60f78f1e 100644 --- a/test/EFCore.InMemory.FunctionalTests/ShadowStateUpdateTest.cs +++ b/test/EFCore.InMemory.FunctionalTests/ShadowStateUpdateTest.cs @@ -23,7 +23,7 @@ public async Task Can_add_update_delete_end_to_end_using_partial_shadow_state() using (var context = new DbContext(optionsBuilder.Options)) { - context.Add(customer); + await context.AddAsync(customer); context.Entry(customer).Property("Name").CurrentValue = "Daenerys"; diff --git a/test/EFCore.Relational.Specification.Tests/EntitySplittingTestBase.cs b/test/EFCore.Relational.Specification.Tests/EntitySplittingTestBase.cs index ca6458f53f1..26d71232400 100644 --- a/test/EFCore.Relational.Specification.Tests/EntitySplittingTestBase.cs +++ b/test/EFCore.Relational.Specification.Tests/EntitySplittingTestBase.cs @@ -21,7 +21,7 @@ public virtual async Task Can_roundtrip() { var meterReading = new MeterReading { ReadingStatus = MeterReadingStatus.NotAccesible, CurrentRead = "100" }; - context.Add(meterReading); + await context.AddAsync(meterReading); TestSqlLoggerFactory.Clear(); diff --git a/test/EFCore.Relational.Specification.Tests/TableSplittingTestBase.cs b/test/EFCore.Relational.Specification.Tests/TableSplittingTestBase.cs index e5045b7e722..6724ca7aa3c 100644 --- a/test/EFCore.Relational.Specification.Tests/TableSplittingTestBase.cs +++ b/test/EFCore.Relational.Specification.Tests/TableSplittingTestBase.cs @@ -167,7 +167,7 @@ await InitializeAsync( using (var context = CreateContext()) { - var scooterEntry = context.Add( + var scooterEntry = await context.AddAsync( new PoweredVehicle { Name = "Electric scooter", @@ -212,7 +212,7 @@ await InitializeAsync( using (var context = CreateContext()) { - var scooterEntry = context.Add( + var scooterEntry = await context.AddAsync( new PoweredVehicle { Name = "Electric scooter", @@ -357,14 +357,14 @@ public virtual async Task Can_insert_dependent_with_just_one_parent() await InitializeAsync(OnModelCreating); using var context = CreateContext(); - context.Add( + await context.AddAsync( new PoweredVehicle { Name = "Fuel transport", SeatingCapacity = 1, Operator = new LicensedOperator { Name = "Jack Jackson", LicenseType = "Class A CDC" } }); - context.Add( + await context.AddAsync( new FuelTank { Capacity = 10000_1, @@ -453,7 +453,7 @@ await InitializeAsync( }; context.Remove(bike); - context.Add(newBike); + await context.AddAsync(newBike); TestSqlLoggerFactory.Clear(); context.SaveChanges(); @@ -503,7 +503,7 @@ await InitializeAsync( }; context.Remove(bike); - context.Add(newBike); + await context.AddAsync(newBike); TestSqlLoggerFactory.Clear(); context.SaveChanges(); @@ -545,7 +545,7 @@ public virtual async Task Warn_when_save_optional_dependent_with_null_values_sen var meterReading = new MeterReading { MeterReadingDetails = new MeterReadingDetail() }; using var context = CreateSharedContext(); - context.Add(meterReading); + await context.AddAsync(meterReading); context.SaveChanges(); @@ -566,7 +566,7 @@ public virtual async Task Warn_when_save_optional_dependent_with_null_values() var meterReading = new MeterReading { MeterReadingDetails = new MeterReadingDetail() }; using var context = CreateSharedContext(); - context.Add(meterReading); + await context.AddAsync(meterReading); TestSqlLoggerFactory.Clear(); @@ -605,7 +605,7 @@ public virtual async Task No_warn_when_save_optional_dependent_at_least_one_none var meterReading = new MeterReading { MeterReadingDetails = new MeterReadingDetail { CurrentRead = "100" } }; - context.Add(meterReading); + await context.AddAsync(meterReading); TestSqlLoggerFactory.Clear(); diff --git a/test/EFCore.Relational.Specification.Tests/TransactionTestBase.cs b/test/EFCore.Relational.Specification.Tests/TransactionTestBase.cs index bc6cf683de8..b5c5f930fe9 100644 --- a/test/EFCore.Relational.Specification.Tests/TransactionTestBase.cs +++ b/test/EFCore.Relational.Specification.Tests/TransactionTestBase.cs @@ -37,7 +37,7 @@ public virtual async Task SaveChanges_can_be_used_with_AutoTransactionBehavior_N { context.Database.AutoTransactionBehavior = AutoTransactionBehavior.Never; - context.Add( + await context.AddAsync( new TransactionCustomer { Id = -77, Name = "Bobble" }); context.Entry(context.Set().OrderBy(c => c.Id).Last()).State = EntityState.Added; @@ -80,7 +80,7 @@ public virtual async Task SaveChanges_can_be_used_with_AutoTransactionsEnabled_f { context.Database.AutoTransactionsEnabled = false; - context.Add( + await context.AddAsync( new TransactionCustomer { Id = -77, Name = "Bobble" }); context.Entry(context.Set().OrderBy(c => c.Id).Last()).State = EntityState.Added; @@ -123,7 +123,7 @@ public virtual async Task SaveChanges_can_be_used_with_AutoTransactionBehavior_A { context.Database.AutoTransactionBehavior = AutoTransactionBehavior.Always; - context.Add( + await context.AddAsync( new TransactionCustomer { Id = -77, Name = "Bobble" }); context.Entry(context.Set().OrderBy(c => c.Id).Last()).State = EntityState.Added; @@ -162,7 +162,7 @@ public virtual async Task SaveChanges_implicitly_starts_transaction_when_needed( { Assert.Equal(AutoTransactionBehavior.WhenNeeded, context.Database.AutoTransactionBehavior); - context.Add( + await context.AddAsync( new TransactionCustomer { Id = 77, Name = "Bobble" }); context.Entry(context.Set().OrderBy(c => c.Id).Last()).State = EntityState.Added; @@ -196,7 +196,7 @@ public virtual async Task SaveChanges_uses_enlisted_transaction(bool async, Auto context.Database.EnlistTransaction(transaction); context.Database.AutoTransactionBehavior = autoTransactionBehavior; - context.Add( + await context.AddAsync( new TransactionCustomer { Id = -77, Name = "Bobble" }); context.Entry(context.Set().OrderBy(c => c.Id).Last()).State = EntityState.Added; @@ -269,7 +269,7 @@ public virtual async Task SaveChanges_uses_enlisted_transaction_after_connection context.Database.EnlistTransaction(transaction); context.Database.AutoTransactionBehavior = autoTransactionBehavior; - context.Add( + await context.AddAsync( new TransactionCustomer { Id = 77, Name = "Bobble" }); context.Entry(context.Set().OrderBy(c => c.Id).Last()).State = EntityState.Added; @@ -320,7 +320,7 @@ public virtual async Task SaveChanges_uses_enlisted_transaction_connectionString context.Database.EnlistTransaction(transaction); context.Database.AutoTransactionBehavior = autoTransactionBehavior; - context.Add( + await context.AddAsync( new TransactionCustomer { Id = 77, Name = "Bobble" }); context.Entry(context.Set().OrderBy(c => c.Id).Last()).State = EntityState.Added; @@ -362,7 +362,7 @@ public virtual async Task SaveChanges_uses_ambient_transaction(bool async, AutoT { context.Database.AutoTransactionBehavior = autoTransactionBehavior; - context.Add( + await context.AddAsync( new TransactionCustomer { Id = -77, Name = "Bobble" }); context.Entry(context.Set().OrderBy(c => c.Id).Last()).State = EntityState.Added; @@ -435,7 +435,7 @@ public virtual async Task SaveChanges_uses_ambient_transaction_with_connectionSt connection = context.Database.GetDbConnection(); Assert.Equal(ConnectionState.Closed, connection.State); - context.Add( + await context.AddAsync( new TransactionCustomer { Id = 77, Name = "Bobble" }); context.Entry(context.Set().OrderBy(c => c.Id).Last()).State = EntityState.Added; @@ -627,7 +627,7 @@ public virtual async Task SaveChanges_does_not_close_connection_opened_by_user(b Assert.Equal(ConnectionState.Open, connection.State); - context.Add( + await context.AddAsync( new TransactionCustomer { Id = 77, Name = "Bobble" }); if (async) @@ -1352,7 +1352,7 @@ public virtual async Task SaveChanges_implicitly_creates_savepoint(bool async) ? await context.Database.BeginTransactionAsync() : context.Database.BeginTransaction(); - context.Add(new TransactionCustomer { Id = 77, Name = "Bobble" }); + await context.AddAsync(new TransactionCustomer { Id = 77, Name = "Bobble" }); if (async) { @@ -1363,8 +1363,8 @@ public virtual async Task SaveChanges_implicitly_creates_savepoint(bool async) context.SaveChanges(); } - context.Add(new TransactionCustomer { Id = 78, Name = "Hobble" }); - context.Add(new TransactionCustomer { Id = 1, Name = "Gobble" }); // Cause SaveChanges failure + await context.AddAsync(new TransactionCustomer { Id = 78, Name = "Hobble" }); + await context.AddAsync(new TransactionCustomer { Id = 1, Name = "Gobble" }); // Cause SaveChanges failure if (async) { @@ -1397,7 +1397,7 @@ public virtual async Task SaveChanges_can_be_used_with_no_savepoint(bool async) ? await context.Database.BeginTransactionAsync() : context.Database.BeginTransaction(); - context.Add(new TransactionCustomer { Id = -77, Name = "Bobble" }); + await context.AddAsync(new TransactionCustomer { Id = -77, Name = "Bobble" }); if (async) { @@ -1408,8 +1408,8 @@ public virtual async Task SaveChanges_can_be_used_with_no_savepoint(bool async) context.SaveChanges(); } - context.Add(new TransactionCustomer { Id = -78, Name = "Hobble" }); - context.Add(new TransactionOrder { Id = 100 }); // Cause SaveChanges failure + await context.AddAsync(new TransactionCustomer { Id = -78, Name = "Hobble" }); + await context.AddAsync(new TransactionOrder { Id = 100 }); // Cause SaveChanges failure if (async) { diff --git a/test/EFCore.Relational.Tests/Update/BatchExecutorTest.cs b/test/EFCore.Relational.Tests/Update/BatchExecutorTest.cs index e166f9a05ce..c5eb05687be 100644 --- a/test/EFCore.Relational.Tests/Update/BatchExecutorTest.cs +++ b/test/EFCore.Relational.Tests/Update/BatchExecutorTest.cs @@ -15,8 +15,8 @@ public async Task ExecuteAsync_calls_Commit_if_no_transaction(bool async) using var context = new TestContext(); var connection = SetupConnection(context); - context.Add(new Foo { Id = "1" }); - context.Add(new Bar { Id = "1" }); + await context.AddAsync(new Foo { Id = "1" }); + await context.AddAsync(new Bar { Id = "1" }); if (async) { @@ -40,7 +40,7 @@ public async Task ExecuteAsync_does_not_call_Commit_if_existing_transaction(bool var transaction = new FakeDbTransaction(connection); context.Database.UseTransaction(transaction); - context.Add( + await context.AddAsync( new Foo { Id = "1" }); if (async) diff --git a/test/EFCore.Specification.Tests/CompositeKeyEndToEndTestBase.cs b/test/EFCore.Specification.Tests/CompositeKeyEndToEndTestBase.cs index 4e912c33b0f..d399c3e8c18 100644 --- a/test/EFCore.Specification.Tests/CompositeKeyEndToEndTestBase.cs +++ b/test/EFCore.Specification.Tests/CompositeKeyEndToEndTestBase.cs @@ -23,7 +23,7 @@ public virtual async Task Can_use_two_non_generated_integers_as_composite_key_en using (var context = CreateContext()) { - var pegasus = context.Add( + var pegasus = await context.AddAsync( new Pegasus { Id1 = ticks, @@ -74,8 +74,8 @@ public virtual async Task Can_use_generated_values_in_composite_key_end_to_end() { context.Database.EnsureCreatedResiliently(); - var added = context.Add( - new Unicorn { Id2 = id2, Name = "Rarity" }).Entity; + var added = (await context.AddAsync( + new Unicorn { Id2 = id2, Name = "Rarity" })).Entity; await context.SaveChangesAsync(); @@ -124,27 +124,27 @@ public virtual async Task Only_one_part_of_a_composite_key_needs_to_vary_for_uni using (var context = CreateContext()) { - var pony1 = context.Add( + var pony1 = (await context.AddAsync( new EarthPony { Id1 = 1, Id2 = 7, Name = "Apple Jack 1" - }).Entity; - var pony2 = context.Add( + })).Entity; + var pony2 = (await context.AddAsync( new EarthPony { Id1 = 2, Id2 = 7, Name = "Apple Jack 2" - }).Entity; - var pony3 = context.Add( + })).Entity; + var pony3 = (await context.AddAsync( new EarthPony { Id1 = 3, Id2 = 7, Name = "Apple Jack 3" - }).Entity; + })).Entity; await context.SaveChangesAsync(); diff --git a/test/EFCore.Specification.Tests/MusicStoreTestBase.cs b/test/EFCore.Specification.Tests/MusicStoreTestBase.cs index 223ec729bf0..8c55c3f88ea 100644 --- a/test/EFCore.Specification.Tests/MusicStoreTestBase.cs +++ b/test/EFCore.Specification.Tests/MusicStoreTestBase.cs @@ -119,10 +119,10 @@ await context.Database.CreateExecutionStrategy().ExecuteAsync( foreach (var album in albums) { - context.Add(album); + await context.AddAsync(album); } - context.SaveChanges(); + await context.SaveChangesAsync(); var result = await controller.Index(context); @@ -256,8 +256,8 @@ await context.Database.CreateExecutionStrategy().ExecuteAsync( { var controller = new CheckoutController(); - var order = context.Add(CreateOrder()).Entity; - context.SaveChanges(); + var order = (await context.AddAsync(CreateOrder())).Entity; + await context.SaveChangesAsync(); var result = await controller.Complete(context, order.OrderId); diff --git a/test/EFCore.Specification.Tests/Query/OwnedQueryTestBase.cs b/test/EFCore.Specification.Tests/Query/OwnedQueryTestBase.cs index 594523f5483..fce67d64529 100644 --- a/test/EFCore.Specification.Tests/Query/OwnedQueryTestBase.cs +++ b/test/EFCore.Specification.Tests/Query/OwnedQueryTestBase.cs @@ -20,13 +20,13 @@ public virtual async Task Can_query_owner_with_different_owned_types_having_same { using (var context = CreateContext()) { - context.Add( + await context.AddAsync( new HeliumBalloon { Id = Guid.NewGuid().ToString(), Gas = new Helium(), }); - context.Add(new HydrogenBalloon { Id = Guid.NewGuid().ToString(), Gas = new Hydrogen() }); + await context.AddAsync(new HydrogenBalloon { Id = Guid.NewGuid().ToString(), Gas = new Hydrogen() }); _ = async ? await context.SaveChangesAsync() : context.SaveChanges(); } diff --git a/test/EFCore.Specification.Tests/SaveChangesInterceptionTestBase.cs b/test/EFCore.Specification.Tests/SaveChangesInterceptionTestBase.cs index 5acdd3db63f..d4f20fcd1ab 100644 --- a/test/EFCore.Specification.Tests/SaveChangesInterceptionTestBase.cs +++ b/test/EFCore.Specification.Tests/SaveChangesInterceptionTestBase.cs @@ -47,7 +47,7 @@ public virtual async Task Intercept_SaveChanges_passively(bool async, bool injec exceptionFromEvent = args.Exception; }; - context.Add(new Singularity { Id = 35, Type = "Red Dwarf" }); + await context.AddAsync(new Singularity { Id = 35, Type = "Red Dwarf" }); using var transaction = context.Database.BeginTransaction(); @@ -117,7 +117,7 @@ public virtual async Task Intercept_SaveChanges_to_suppress_save(bool async, boo exceptionFromEvent = args.Exception; }; - context.Add(new Singularity { Id = 35, Type = "Red Dwarf" }); + await context.AddAsync(new Singularity { Id = 35, Type = "Red Dwarf" }); using var transaction = context.Database.BeginTransaction(); @@ -203,7 +203,7 @@ public virtual async Task Intercept_SaveChanges_to_change_result(bool async, boo exceptionFromEvent = args.Exception; }; - context.Add(new Singularity { Id = 35, Type = "Red Dwarf" }); + await context.AddAsync(new Singularity { Id = 35, Type = "Red Dwarf" }); using var transaction = context.Database.BeginTransaction(); @@ -285,7 +285,7 @@ public virtual async Task Intercept_SaveChanges_failed(bool async, bool inject, if (!concurrencyError) { - context.Add(new Singularity { Id = 35, Type = "Red Dwarf" }); + await context.AddAsync(new Singularity { Id = 35, Type = "Red Dwarf" }); var ___ = async ? await context.SaveChangesAsync() : context.SaveChanges(); context.ChangeTracker.Clear(); } @@ -490,7 +490,7 @@ public virtual async Task Intercept_SaveChanges_with_multiple_interceptors(bool new IInterceptor[] { new PassiveSaveChangesInterceptor(), interceptor1, interceptor2 }, new IInterceptor[] { interceptor3, interceptor4, new PassiveSaveChangesInterceptor() }); - context.Add(new Singularity { Id = 35, Type = "Red Dwarf" }); + await context.AddAsync(new Singularity { Id = 35, Type = "Red Dwarf" }); using var transaction = context.Database.BeginTransaction(); diff --git a/test/EFCore.Specification.Tests/WithConstructorsTestBase.cs b/test/EFCore.Specification.Tests/WithConstructorsTestBase.cs index 01198bfe473..7a915cb28ac 100644 --- a/test/EFCore.Specification.Tests/WithConstructorsTestBase.cs +++ b/test/EFCore.Specification.Tests/WithConstructorsTestBase.cs @@ -741,7 +741,7 @@ public virtual async Task Add_immutable_record() { var immutableBlog = new BlogAsImmutableRecord(title); - context.Add(immutableBlog); + await context.AddAsync(immutableBlog); await context.SaveChangesAsync(); Assert.NotEqual(0, immutableBlog.BlogId); diff --git a/test/EFCore.SqlServer.FunctionalTests/EntitySplittingSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/EntitySplittingSqlServerTest.cs index 3dfac60c351..8eae6f0a8ff 100644 --- a/test/EFCore.SqlServer.FunctionalTests/EntitySplittingSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/EntitySplittingSqlServerTest.cs @@ -46,7 +46,7 @@ ON [MeterReadingDetails] { var meterReading = new MeterReading { ReadingStatus = MeterReadingStatus.NotAccesible, CurrentRead = "100" }; - context.Add(meterReading); + await context.AddAsync(meterReading); TestSqlLoggerFactory.Clear(); diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/QueryBugsTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/QueryBugsTest.cs index 4db6b45e0fc..056d446b0de 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/QueryBugsTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/QueryBugsTest.cs @@ -3974,7 +3974,7 @@ public virtual async Task Multilevel_owned_entities_determine_correct_nullabilit using (var context = contextFactory.CreateContext()) { - context.Add(new MyContext13079.BaseEntity13079()); + await context.AddAsync(new MyContext13079.BaseEntity13079()); context.SaveChanges(); AssertSql( @@ -9058,7 +9058,7 @@ public async Task SaveChangesAsync_accepts_changes_with_ConfigureAwait_true_2284 try { - context.Add(observableThing); + await context.AddAsync(observableThing); await context.SaveChangesAsync(); } finally diff --git a/test/EFCore.SqlServer.FunctionalTests/SequentialGuidEndToEndTest.cs b/test/EFCore.SqlServer.FunctionalTests/SequentialGuidEndToEndTest.cs index cca3b22e369..80c81198af1 100644 --- a/test/EFCore.SqlServer.FunctionalTests/SequentialGuidEndToEndTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/SequentialGuidEndToEndTest.cs @@ -20,7 +20,7 @@ public async Task Can_use_sequential_GUID_end_to_end_async() for (var i = 0; i < 50; i++) { - context.Add( + await context.AddAsync( new Pegasus { Name = "Rainbow Dash " + i }); } @@ -54,13 +54,13 @@ public async Task Can_use_explicit_values() for (var i = 0; i < 50; i++) { guids.Add( - context.Add( + (await context.AddAsync( new Pegasus { Name = "Rainbow Dash " + i, Index = i, Id = Guid.NewGuid() - }).Entity.Id); + })).Entity.Id); } await context.SaveChangesAsync(); diff --git a/test/EFCore.SqlServer.FunctionalTests/SqlServerEndToEndTest.cs b/test/EFCore.SqlServer.FunctionalTests/SqlServerEndToEndTest.cs index a166a1babf3..a354af53ae0 100644 --- a/test/EFCore.SqlServer.FunctionalTests/SqlServerEndToEndTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/SqlServerEndToEndTest.cs @@ -443,11 +443,11 @@ public async Task Can_add_and_remove_entities_with_keys_of_different_type() context.Database.EnsureCreatedResiliently(); var first = new Int32CompositeKeys { Id1 = 1, Id2 = 2 }; - context.Add(first); + await context.AddAsync(first); var second = new Int64CompositeKeys { Id1 = 1, Id2 = 2 }; - context.Add(second); + await context.AddAsync(second); await context.SaveChangesAsync(); } @@ -567,7 +567,7 @@ public async Task Can_insert_TPT_dependents_with_identity() context.Database.EnsureCreatedResiliently(); var ferrari = new Ferrari { Special = new Car() }; - context.Add(ferrari); + await context.AddAsync(ferrari); await context.SaveChangesAsync(); @@ -1440,9 +1440,9 @@ public async Task Can_save_and_query_with_schema() using (var context = new SchemaContext(options)) { - context.Add( + await context.AddAsync( new Jack { MyKey = 1 }); - context.Add( + await context.AddAsync( new Black { MyKey = 2 }); context.SaveChanges(); } @@ -1549,7 +1549,7 @@ private async Task RoundTripChanges() blog2.NotFigTime = new DateTime(); blog2.AndChew = null; - var blog3 = context.Add(new TBlog()).Entity; + var blog3 = (await context.AddAsync(new TBlog())).Entity; await context.SaveChangesAsync(); @@ -1581,7 +1581,7 @@ private static async Task CreateBlogDatabaseAsync(DbContext cont { context.Database.EnsureCreatedResiliently(); - var blog1 = context.Add( + var blog1 = (await context.AddAsync( new TBlog { Name = "Blog1", @@ -1599,8 +1599,8 @@ private static async Task CreateBlogDatabaseAsync(DbContext cont OrUSkint = 8888888, OrUShort = 888888888888888, AndChew = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 } - }).Entity; - var blog2 = context.Add( + })).Entity; + var blog2 = (await context.AddAsync( new TBlog { Name = "Blog2", @@ -1618,7 +1618,7 @@ private static async Task CreateBlogDatabaseAsync(DbContext cont OrUSkint = 8888888, OrUShort = 888888888888888, AndChew = new byte[16] - }).Entity; + })).Entity; await context.SaveChangesAsync(); return new[] { blog1, blog2 }; diff --git a/test/EFCore.SqlServer.FunctionalTests/SqlServerValueGenerationScenariosTest.cs b/test/EFCore.SqlServer.FunctionalTests/SqlServerValueGenerationScenariosTest.cs index 2f646fc733b..3262116bcd9 100644 --- a/test/EFCore.SqlServer.FunctionalTests/SqlServerValueGenerationScenariosTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/SqlServerValueGenerationScenariosTest.cs @@ -1011,7 +1011,7 @@ RETURN @FullName { using (var context = new BlogContextComputedColumn(testStore.Name)) { - context.Add(new FullNameBlog()); + await context.AddAsync(new FullNameBlog()); var exception = async ? await Assert.ThrowsAsync(() => context.SaveChangesAsync()) @@ -1056,7 +1056,7 @@ ON [FullNameBlogs] { using (var context = new BlogContextComputedColumn(testStore.Name)) { - context.Add(new FullNameBlog()); + await context.AddAsync(new FullNameBlog()); var exception = async ? await Assert.ThrowsAsync(() => context.SaveChangesAsync()) diff --git a/test/EFCore.SqlServer.FunctionalTests/TransactionSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/TransactionSqlServerTest.cs index 81104100421..57f7bcf27f1 100644 --- a/test/EFCore.SqlServer.FunctionalTests/TransactionSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/TransactionSqlServerTest.cs @@ -46,7 +46,7 @@ public virtual async Task Savepoints_are_disabled_with_MARS(bool async) var orderId = 300; foreach (var _ in context.Set()) { - context.Add(new TransactionOrder { Id = orderId++, Name = "Order " + orderId }); + await context.AddAsync(new TransactionOrder { Id = orderId++, Name = "Order " + orderId }); if (async) { await context.SaveChangesAsync(); diff --git a/test/EFCore.Tests/ChangeTracking/Internal/OwnedFixupTest.cs b/test/EFCore.Tests/ChangeTracking/Internal/OwnedFixupTest.cs index 1efb65a44fe..5c166578b6f 100644 --- a/test/EFCore.Tests/ChangeTracking/Internal/OwnedFixupTest.cs +++ b/test/EFCore.Tests/ChangeTracking/Internal/OwnedFixupTest.cs @@ -5045,7 +5045,7 @@ public async Task SaveChanges_when_owner_has_PK_with_default_values(bool async) { // Trying to do the same thing again will throw since only one row can have ID zero. - context.Add(new Blog { Type = new OwnedType { Value = "A" } }); + await context.AddAsync(new Blog { Type = new OwnedType { Value = "A" } }); Assert.Throws(() => context.SaveChanges()); } } diff --git a/test/EFCore.Tests/DbContextTest.cs b/test/EFCore.Tests/DbContextTest.cs index 7f9bc84f643..e8135fea4e5 100644 --- a/test/EFCore.Tests/DbContextTest.cs +++ b/test/EFCore.Tests/DbContextTest.cs @@ -499,8 +499,8 @@ public async Task SaveChanges_calls_DetectChanges_by_default(bool async) { Assert.True(context.ChangeTracker.AutoDetectChangesEnabled); - var product = context.Add( - new Product { Id = 1, Name = "Little Hedgehogs" }).Entity; + var product = (await context.AddAsync( + new Product { Id = 1, Name = "Little Hedgehogs" })).Entity; if (async) { @@ -541,8 +541,8 @@ public async Task Auto_DetectChanges_for_SaveChanges_can_be_switched_off(bool as context.ChangeTracker.AutoDetectChangesEnabled = false; Assert.False(context.ChangeTracker.AutoDetectChangesEnabled); - var product = context.Add( - new Product { Id = 1, Name = "Little Hedgehogs" }).Entity; + var product = (await context.AddAsync( + new Product { Id = 1, Name = "Little Hedgehogs" })).Entity; if (async) { diff --git a/test/EFCore.Tests/EventSourceTest.cs b/test/EFCore.Tests/EventSourceTest.cs index 84120cdf572..3ebd4739fe6 100644 --- a/test/EFCore.Tests/EventSourceTest.cs +++ b/test/EFCore.Tests/EventSourceTest.cs @@ -37,7 +37,7 @@ public async Task Counts_when_SaveChanges_is_called(bool async) { using var context = new SomeDbContext(); - context.Add(new Foo()); + await context.AddAsync(new Foo()); _ = async ? await context.SaveChangesAsync() : context.SaveChanges(); @@ -109,7 +109,7 @@ public async Task Counts_when_DbUpdateConcurrencyException_is_thrown(bool async) using var context = new SomeDbContext(); var entity = new Foo(); - context.Add(entity); + await context.AddAsync(entity); context.SaveChanges(); using (var innerContext = new SomeDbContext()) diff --git a/test/EFCore.Tests/Storage/ValueConverterTest.cs b/test/EFCore.Tests/Storage/ValueConverterTest.cs index 3509768e9a4..00ab7f98eb2 100644 --- a/test/EFCore.Tests/Storage/ValueConverterTest.cs +++ b/test/EFCore.Tests/Storage/ValueConverterTest.cs @@ -15,7 +15,7 @@ public async Task Value_converters_are_run_for_in_memory_database(bool async) { using (var context = new InMemoryConvertersContext()) { - context.Add( + await context.AddAsync( new Person { Id = async ? 1 : 2,