【发布时间】:2017-11-14 07:36:59
【问题描述】:
尝试通过在连接字符串中设置Synchronous=Off 来优化asp.net 应用程序中的Sqlite,但不支持关键字https://github.com/ericsink/SQLitePCL.raw/issues/147
https://github.com/aspnet/Microsoft.Data.Sqlite/issues/354
问题 #354 的底部提出了一个带有指向连接的 pragma 命令的解决方案
using (var command = connection.CreateCommand())
{
command.CommandText = "PRAGMA foreign_keys = true;";
command.ExecuteNonQuery();
}
尝试将此用于Synchronous
https://sqlite.org/pragma.html#pragma_synchronous 但不确定在哪里/如何获得与我的 DbContext 类型对应的正确连接。
【问题讨论】: