diff --git a/src/Microsoft.EntityFrameworkCore/Properties/CoreStrings.Designer.cs b/src/Microsoft.EntityFrameworkCore/Properties/CoreStrings.Designer.cs index d3ff866c0b4..b7a8a023ee7 100644 --- a/src/Microsoft.EntityFrameworkCore/Properties/CoreStrings.Designer.cs +++ b/src/Microsoft.EntityFrameworkCore/Properties/CoreStrings.Designer.cs @@ -197,7 +197,7 @@ public static string MultipleProvidersConfigured([CanBeNull] object storeNames) } /// - /// No database providers are configured. Configure a database provider by overriding OnConfiguring in your DbContext class or in the AddDbContext method when setting up services. + /// A database has not been configured for this context. If you are not using dependency injection, override the OnConfiguring method in your context class to configure the database. If you are using dependency injection, use the AddDbContext method to register your context as a service and configure the database. In ASP.NET Core this is done in the ConfigureServices method of your Startup class. Also ensure that you are resolving the context from services and are not directly creating instances of it. /// public static string NoProviderConfigured { diff --git a/src/Microsoft.EntityFrameworkCore/Properties/CoreStrings.resx b/src/Microsoft.EntityFrameworkCore/Properties/CoreStrings.resx index b66bd512c6e..0416695f6d2 100644 --- a/src/Microsoft.EntityFrameworkCore/Properties/CoreStrings.resx +++ b/src/Microsoft.EntityFrameworkCore/Properties/CoreStrings.resx @@ -187,7 +187,7 @@ The database providers {storeNames}are configured. A context can only be configured to use a single database provider. - No database providers are configured. Configure a database provider by overriding OnConfiguring in your DbContext class or in the AddDbContext method when setting up services. + A database has not been configured for this context. If you are not using dependency injection, override the OnConfiguring method in your context class to configure the database. If you are using dependency injection, use the AddDbContext method to register your context as a service and configure the database. In ASP.NET Core this is done in the ConfigureServices method of your Startup class. Also ensure that you are resolving the context from services and are not directly creating instances of it. No database providers are available. Ensure that database provider services are added inside the call to AddEntityFramework on your ServiceCollection.