加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

xamarin – 将SQLite-net升级到SQLite.net – 创建SQLiteConnect

发布时间:2020-12-12 19:06:18 所属栏目:百科 来源:网络整理
导读:我曾经在我的共享项目中打开我的SQLiteConnection,如下所示: var conn = new SQLiteConnection("MyDb.db3"); 构造函数已更改为以下签名: public SQLiteConnection(ISQLitePlatform sqlitePlatform,string databasePath,bool storeDateTimeAsTicks = true,I
我曾经在我的共享项目中打开我的SQLiteConnection,如下所示:
var conn = new SQLiteConnection("MyDb.db3");

构造函数已更改为以下签名:

public SQLiteConnection(ISQLitePlatform sqlitePlatform,string databasePath,bool storeDateTimeAsTicks = true,IBlobSerializer serializer = null,IDictionary<string,TableMapping> tableMappings = null,IDictionary<Type,string> extraTypeMappings = null,IContractResolver resolver = null);
    public SQLiteConnection(ISQLitePlatform sqlitePlatform,SQLiteOpenFlags openFlags,IContractResolver resolver = null);

我无法找到任何关于如何在我的共享库中实现它的示例/文档.

一旦你找到它就很容易.命名空间SQLite.Net.Platform包含ISQLitePlatforminterface的实现.

我必须在de平台特定的库而不是共享库中实现它.

new SQLiteConnection(new SQLite.Net.Platform.XamarinAndroid.SQLitePlatformAndroid(),Path.Combine(path,db));

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读