I have added the sqlite-net-plc package to my project and created a Database class like this:
public class Database
{
public Database()
{
var dbPath = Path.Combine(FileSystem.AppDataDirectory, "databaseTest.db3");
Connection = new SQLiteAsyncConnection(dbPath);
Connection.CreateTableAsync<User>().Wait();
}
public SQLiteAsyncConnection Connection { get; set; }
}
This seems to work fine with Android applications allowing me to manipulate the database from anywhere.
However, when I run this application through an IOS simulator with an active Mac connection I get the following error:
The type initializer for 'SQLite.SQLiteConnection' threw an exception.
I believe that an active connection to a SQLite database cannot be resolved but I don't know why. Any insight on this would be great.
Thanks in advance.