CRUD operations (create, read, update, delete) are the four basic functions in persistent storage. Whatever the storage option, you will need to perform these actions.
There are patterns and best practices to achieve reusable data access components and the most common implementation is the Repository Pattern. In this recipe, we create a generic repository that we use to perform CRUD operations against a SQLite database.
In Visual Studio, create a Blank App (Xamarin.Forms Portable) project named
XamFormsCRUDSQLite
from the top menu, File | New | Project….For all the projects in the solution, we need the
SQLite.Net-PCL
and SQLite.Net.Async-PCL NuGet packages. Right-click on every project and choose Manage NuGet Packages; search and install the packages.Create a folder named
Data
: in theXamFormsCRUDSQLite
PCL, right-click Add | New Folder.In the newly created folder, we assume that you created
ISQLiteAsyncConnectionService
and also the platform...