I'm developing a cross platform application with Xamarin for Android, iOS and Windows Phone. I'm creating a PCL library that contains all my business logic including calls to my REST API. For now this seem to work fine, however, I need to store bits of information in a persistent space, such as API authentication keys etc, and I figured I might as well use Sqlite for this, it seems to be supported on all three platforms.
The problem I'm running into is that System.Data
and Mono.Data.Sqlite
don't seem to be available within the context of a PCL project.
Even if my PCL library can't, or doesn't, link with the required assemblies, I should at least be able to use the references (through using
) in my PCL library, right? I mean, I should be able to have the application be responsible for creating a database connection and then use dependency injection to inject that connection into my library. But seems I can't even make references in my code to any the System.Data
and Mono.Data.Sqlite
at all.
How do I abstract my data layer in a PCL library with Xamarin for Android, iOS and Windows Phone?
Aucun commentaire:
Enregistrer un commentaire