Bug #84814 EFCore cannot use DBContext.SaveChangesAsync
Submitted: 3 Feb 2017 22:06 Modified: 14 Aug 2017 17:45
Reporter: Gabriela Martinez Sanchez Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:6.10.0 OS:Any
Assigned to: Gabriela Martinez Sanchez CPU Architecture:Any

[3 Feb 2017 22:06] Gabriela Martinez Sanchez
Description:
Connector/net does not support Async for savechanges.

How to repeat:
Create an application that uses EF Core and run the following code

 var serviceCollection = new ServiceCollection();
            serviceCollection.AddEntityFrameworkMySQL()
              .AddDbContext<ComputedColumnContext>();

            var serviceProvider = serviceCollection.BuildServiceProvider();

            using (var context = serviceProvider.GetRequiredService<ComputedColumnContext>())
            {
                context.Database.EnsureCreated();
                var e = new Employee { EmployeeId = 1, FirstName = "Hi", LastName = "LastName" };
                context.Employees.Add(e);
                await context.SaveChangesAsync();
                Assert.False(context.Employees.Any());
                context.Database.EnsureDeleted();
            }

Suggested fix:
Add the implementation for the Async support.
[14 Aug 2017 17:45] Christine Cole
Posted by developer:
 
Fixed as of the upcoming MySQL Connector/Net 6.10.3 release, and here's the changelog entry:

Some methods in the DbContext class were not supported for use with
asynchronous operations.

Thank you for the bug report.