CoreStrings.NoProviderConfiguredFailedToResolveService(Object) Method

Definition

Unable to resolve service for type '{service}'. This is often because no database provider has been configured for this DbContext. A provider can be configured by overriding the 'DbContext.OnConfiguring' method or by using 'AddDbContext' on the application service provider. If 'AddDbContext' is used, then also ensure that your DbContext type accepts a DbContextOptions<TContext> object in its constructor and passes it to the base constructor for DbContext.

C#
public static string NoProviderConfiguredFailedToResolveService (object service);
C#
public static string NoProviderConfiguredFailedToResolveService (object? service);

Parameters

service
Object

Returns

Applies to

Product Versions
Entity Framework Core 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0