Implementing native setup requirements for SQLite
Our next step is to add the final setup requirements. Each device platform has a specific framework that it must use when setting up the connection to the local database. This means we are going to add another dependency-injected interface to set these native side requirements.
Add a new file called ISqliteSetup.cs
to the Storage
folder and implement the following:
public interface ISQLiteSetup { string DatabasePath { get; set; } ISQLitePlatform Platform { get; set; } }
Before we implement this class in the platform projects, we need to add the following SQLite NuGet packages for all platform projects:
SQLite.Net.Async-PCL
SQLite.Net.Core-PCL
SQLite.Net-PCL
Now let's turn our attention to the iOS project. Add a new folder called DataAccess
, add in a new file called SQLiteSetup.cs
, and implement the following:
public class SQLiteSetup : ISQLiteSetup { public string DatabasePath { get; set; } public...