How do I retrieve and set user_version in SQLite DB with EF

前端 未结 1 1332
天命终不由人
天命终不由人 2021-02-13 21:56

What I am trying to do is load in and set the user_version (PRAGMA user_version) from my SQLite database. I am using entity framework, but if I can\'t do it through that, then I

1条回答
  •  执念已碎
    2021-02-13 23:00

    Well...I eventually figured it out. I believe this is the best way to do it while using entity framework.

    To set the user_version you need to do this...

    this.DatabaseConnection.ExecuteStoreCommand("PRAGMA user_version = 5");
    

    To get the user_version you need to do this...

    long result = this.DatabaseConnection.ExecuteStoreQuery("PRAGMA user_version").FirstOrDefault();
    

    0 讨论(0)
提交回复
热议问题