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. ...

Get Xamarin Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.