![]() However adding a PCL helper class library that has only the synchronous SQLite.Net and synchronous extensions, and fetching the sync connection from there, did not help. Xamarin.Forms supports database-driven applications using the SQLite database engine, which makes it possible to load and save objects in shared, common code across platforms.This article. Right-click and choose Manage NuGet Packages to add SQLite.Net support. It would appear that adding the async packages somehow blocks the synchronous extensions. To add SQLite support to a Xamarin.Forms PCL template solution, start with the shared PCL library. My first idea was: await db.RunInTransactionAsync ( Using SQLiteNetExtensionsAsync.Extensions ĭb = DependencyService.Get ().GetAsyncConnection () Īs a side note, I could additionally do the following, but I don't, having read that it is unwise to mix sync and async database operations: dbSync = DependencyService.Get ().GetSyncConnection () On startup in my Xamarin.Forms PCL, I have: using Xamarin.Forms Add Necessary packages (Eg: SQLite) Add NuGet Package Right-click on the Solution Folder and Choose Manage NuGet Package NuGet packages Search for sqlite-net-pcl package and Click Add Package. I'm trying to figure out how, in a transaction, to use SQLITE async extension methods such as InsertOrReplaceWithChildrenAsync (NuGet from TwinCoders).
0 Comments
Leave a Reply. |