且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用实体框架6和SQLite问题

更新时间:2023-02-13 16:53:20

根据magicandre1981的评论,我开始在提供者节点的语法更密切地关注。我发现我的组装是一个不同的版本比在type属性指定的,虽然我没有插入或感动的是特定的行。通过删除强命名,我得到了.NET来加载库。作为参考,这里的新行:

Based on magicandre1981's comment, I began to look more closely at the syntax of the provider node. I found that my assembly was a different version than what was specified in the type attribute, though I had not inserted or touched that particular line. By deleting the strong naming, I got .Net to load the library. For reference, here's the new line:

<provider invariantName="System.Data.SQLite" type="System.Data.SQLite.SQLiteProviderServices, System.Data.SQLite.Linq" />

这让我回到正轨,我能够与博客上的名称相符我的结果。

That put me back on track and I was able to match my results with the ones on the blog.

我觉得有必要注意,但是,我已经决定,SQLite是不适合的实体框架,因为太多的关键功能缺失。我切换到SQL Server精简版,这是我经过的NuGet安装。一个简单的拧紧,我的连接字符串,我与实体框架的全功率运行。它超过一分钟采取以下,相比于多小时猛击这是SQLite的。我建议你​​切换数据库如果可能的话,System.Data.SQLite只是没有准备好实体框架。

I feel compelled to note, however, that I have decided that SQLite is not a good fit for the Entity Framework, as too many critical functions are missing. I switched over to SQL Server Compact Edition, which I installed via NuGet. A simple tweak to my Connection String and I was running with the full power of Entity Framework. It took less than a minute, compared to the multi-hour slog that was SQLite. I'd recommend switching databases if possible, System.Data.SQLite just isn't ready for the Entity Framework.