You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to access the DBConnection directly in a module so I can use dapper.contrib to add custom tables in my module. I added the following code in Startup.cs
public override void Configure(IApplicationBuilder builder, IRouteBuilder routes, IServiceProvider serviceProvider)
{
var connection = serviceProvider.GetRequiredService<IDbConnection>();
//var connection = serviceProvider.GetService<IDbConnection>();
}
Got the following exception:
InvalidOperationException: No service for type 'System.Data.IDbConnection' has been registered.
I tried to access the DBConnection directly in a module so I can use dapper.contrib to add custom tables in my module. I added the following code in Startup.cs
Got the following exception:
InvalidOperationException: No service for type 'System.Data.IDbConnection' has been registered.
I think this would also resolve #2248
The text was updated successfully, but these errors were encountered: