我正在尝试使用 SQLite.net 在我的 PCL 中实现 OneToMany 关系。我有异步扩展包 (SQLiteNetExtensions.Async),我将代码基于 https://bitbucket.org/twincoders/sqlite-net-extensions中的示例。我正在使用 SQLiteAsyncConnection,但 UpdateWithChildren 方法似乎不可用,只能使用 SQLiteConnection。
using SQLite.Net;
using SQLite.Net.Async;
using SQLite.Net.Interop;
using SQLiteNetExtensions.Extensions;
private readonly SQLiteAsyncConnection conn;
public ActivityRepository(ISQLitePlatform platform, string dbPath)
{
var connectionFactory = new Func<SQLiteConnectionWithLock>(() => new SQLiteConnectionWithLock(platform, new SQLiteConnectionString(dbPath, storeDateTimeAsTicks: true)));
conn = new SQLiteAsyncConnection(connectionFactory);
}
public void method(object object) {
conn.UpdateWithChildren(object); --function not available
}