他のことを試してみましょう:
まず、DbContextでOnConfiguringを作成します メソッド:
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder
.UseMYSQL("... connection string ...");
}
次に、最初にConfigureServices メソッド、次のようにDbContextを構成します:
services.AddDbContext<MyContext>();