尝试通过在连接字符串中设置Synchronous=Off来优化asp.net应用程序中的Sqlite,但https://github.com/ericsink/SQLitePCL.raw/issues/147 https://github.com/aspnet/Microsoft.Data.Sqlite/issues/354不支持关键字
问题#354的底部建议使用指向连接的杂注命令的解决方案
using (var command = connection.CreateCommand())
{
command.CommandText = "PRAGMA foreign_keys = true;";
command.ExecuteNonQuery();
}尝试将其用于Synchronous https://sqlite.org/pragma.html#pragma_synchronous,但不确定在何处/如何获得与我的DbContext类型对应的正确连接。
发布于 2017-11-14 07:36:59
下拉到EF核心中的ADO.NET连接,使用如下代码:
db.Database.OpenConnection();
try
{
var connection = db.Database.GetDbConnection();
// TODO: Use connection
}
finally
{
db.Database.CloseConnection();
}https://stackoverflow.com/questions/46527590
复制相似问题