SQLite を使用する Xamarin Forms プロジェクトがあります。関連するフィールドに正しい外部キー、ManyToOne、Cascading オプションを持つ親と子のモデルがあります。
Scott Hanselman の AsyncLock クラス ( http://www.hanselman.com/blog/ComparingTwoTechniquesInNETAsynchronousCoordinationPrimitives.aspx ) を次のような db メソッドで 使用しています。
public async Task<List<Client>> GetAllAsync()
{
List<Client> clients = new List<Client>();
using (await SQLiteBase.Mutex.LockAsync().ConfigureAwait(false))
{
//SQLiteAsyncConnection _connection is set up elsewhere...
clients = await _sqLiteBase._connection.Table<Client>().ToListAsync().ConfigureAwait(false);
}
return clients;
}
今のところ問題ありません。私が直面している問題は、この接続でカスケード アクションが表示されないことです。SQLiteConnection
-WithChildren
メソッドを持つ normal を追加しましたが、SQLiteAsyncConnection
接続を使用する必要があります。
SQLite.Net、SQLiteNetExtensions、SQLite.Net.Async、および SQLitePCL.raw への参照があります。
WithChildren
~メソッドが非同期接続オブジェクトに表示されないのはなぜですか?