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

我曾经在我的共享项目中打开我的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, string databasePath, SQLiteOpenFlags openFlags, bool storeDateTimeAsTicks = true, IBlobSerializer serializer = null, IDictionary<string, TableMapping> tableMappings = null, IDictionary<Type, string> extraTypeMappings = null, IContractResolver resolver = null);

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

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

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

new SQLiteConnection(new SQLite.Net.Platform.XamarinAndroid.SQLitePlatformAndroid(), Path.Combine(path, db));
相关文章
相关标签/搜索