I’m trying to use the NamedConnection attribute with a default autoquery request dto…
Global.asax snippet:
var dbFactory = new OrmLiteConnectionFactory(sqlConnectionString,SqlServerDialect.Provider);
container.Register<IDbConnectionFactory>(dbFactory);
dbFactory.RegisterConnection("pgData", pgConnectionString, PostgreSqlDialect.Provider);
AutoQuery class:
[NamedConnection("pgData")]
[Route("/pgdata/search", "GET")]
public class SearchPgData : QueryDb<PgPoco>
{
}
When I use the AutoQuery Viewer, however, the named connection query requests still seem to be using the default SQL connection, and I get a SQL-specific exception. Am I using the NamedConnection attribute wrong?
Thanks,
Julian