【问题标题】:Is it possible to update a SQLite database file using Entity Framework 6 in database-first?是否可以在数据库优先中使用 Entity Framework 6 更新 SQLite 数据库文件?
【发布时间】:2016-03-02 15:52:45
【问题描述】:

我将 SQLite 与 Entity Framework 6 数据库优先模式一起使用。

如果有办法可以检查数据库文件与当前.edmx 文件(自动生成的代理模型类)并比较它,如果数据库是旧的或缺少某些表或 FX 或索引,那将非常有帮助,然后更新当前的 SQLite 文件或添加缺少的表/FX/Index。

喜欢:

 using (var ctx = new testDBEntities())
 {
       if (ctx.Database.CheckIfDatabaseIsOld)
       {
          ctx.Database.UpdateCurrentSqliteFileToNew();
       }
 }

【问题讨论】:

    标签: c# .net entity-framework sqlite entity-framework-6


    【解决方案1】:

    不,sqlite 提供程序不支持代码优先。但是,SQL Server Compact 提供程序可以

    【讨论】:

    猜你喜欢
    • 2016-03-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-31
    • 2021-03-11
    • 1970-01-01
    • 1970-01-01
    • 2013-06-13
    相关资源
    最近更新 更多