According to the docs there should be a ProfiledDbConnection class in MiniProfiler. However, even with the following using statements it doesn’t seem to be pulled in.
using ServiceStack.MiniProfiler;
using ServiceStack.MiniProfiler.Data;
Seems to find ProfiledConnection but not ProfiledDbConnection. However this other MiniProfiler discussion questions whether it’s available in .NET Core.
Is the ProfiledDbConnection not available in .NET Core?
In case it helps
var connectionFactory = new OrmLiteConnectionFactory(connectionString)
{
ConnectionFilter = x => new ProfiledDbConnection(x, Profiler.Current)
};
connectionFactory.RegisterConnection("db1",
new OrmLiteConnectionFactory(db1ConnStr, PostgreSqlDialect.Provider, true)
{ ConnectionFilter = x => new ProfiledDbConnection(x, Profiler.Current) });
connectionFactory.RegisterConnection("db2",
new OrmLiteConnectionFactory(db2ConnStr, PostgreSqlDialect.Provider, true)
{ ConnectionFilter = x => new ProfiledDbConnection(x, Profiler.Current) });
connectionFactory.RegisterConnection("db3",
new OrmLiteConnectionFactory(db3ConnStr, PostgreSqlDialect.Provider, true)
{ ConnectionFilter = x => new ProfiledDbConnection(x, Profiler.Current) });
container.Register<IDbConnectionFactory>(connectionFactory);
When using ProfiledConnection instead of ProfiledDbConnection, Profile.Current doesn’t work b/c it’s not an IDbProfiler. However I don’t see a IDbProfiler option.
Maybe it’s been a long day and I’m missing something simple…