cal*_*sto 1 c# xamarin.forms sqlite-net-extensions
我有一个使用SQLite的Xamarin Forms项目。我有一个父子模型,在相关字段上具有正确的外键,ManyToOne和级联选项。
我一直在这样的db方法中使用Scott Hanselman的AsyncLock类(http://www.hanselman.com/blog/ComparingTwoTechniquesInNETAsynchronousCoordinationPrimitives.aspx),如下所示:
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;
}
Run Code Online (Sandbox Code Playgroud)
到目前为止没有问题。我面临的问题是,我看不到此连接上的级联操作。我添加了一个带有SQLiteConnection- WithChildren方法的normal ,但是我需要使用SQLiteAsyncConnection连接。
我引用了SQLite.Net,SQLiteNetExtensions,SQLite.Net.Async和SQLitePCL.raw。
为什么WithChildren在异步连接对象上看不到〜方法?
| 归档时间: |
|
| 查看次数: |
1544 次 |
| 最近记录: |