1
SQLite.net을 사용하여 내 PCL 내에서 OneToMany 관계를 구현하려고합니다. 비동기 확장 패키지 (SQLiteNetExtensions.Async)가 있으며 https://bitbucket.org/twincoders/sqlite-net-extensions에있는 예제 코드를 기반으로합니다. SQLiteAsyncConnection을 사용하고 있지만 SQLiteConnection에서만 UpdateWithChildren 메서드를 사용할 수없는 것 같습니다.SQLiteAsyncConnection UpdateWithChildren을 사용할 수 없습니다.
using SQLite.Net;
using SQLite.Net.Async;
using SQLite.Net.Interop;
using SQLiteNetExtensionsAsync.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 Task method(object object) {
return conn.UpdateWithChildrenAsync(object);
}
모든 비동기 방법을 기다려온 또는 반환해야 Task
을 반환 있습니다 :
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
}
감사합니다. 비동기 패키지가 설치되어 있었고 방금 UpdateWithChildrenAsync 메서드를 사용하지 않았습니다. – Carl