答案 0 :(得分:3)
我选择的解决方案是覆盖与this solution类似的SqlServerOrmLiteDialectProvider.CreateDbConnection()
。
var dbFactory = new OrmLiteConnectionFactory(
"<connection string>",
SqlServerWithGlimpseDialectProvider.Instance);
public class SqlServerWithGlimpseDialectProvider
: SqlServerOrmLiteDialectProvider
{
public new static SqlServerWithGlimpseDialectProvider Instance = new SqlServerWithGlimpseDialectProvider();
public override IDbConnection CreateConnection(string connectionString, Dictionary<string, string> options)
{
return new GlimpseDbConnection(
base.CreateConnection(connectionString, options) as System.Data.SqlClient.SqlConnection);
}
}
SQL现在分析:
答案 1 :(得分:1)
我不是ServiceStack专家,但有一些文档可以让它设置好。您是否尝试过关注these instructions?