Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class PeopleRepository
{
private SQLiteConnection db = null;
protected static PeopleRepository me;
static PeopleRepository()
{
me = new PeopleRepository();
}
protected PeopleRepository()
{
db = new SQLiteConnection(Constants.DbFilePath);
db.CreateTable<Person>();
}
public static int SavePerson(Person person)
{
me.db.Insert(person);
return person.Id;
}
public static Person GetPerson(int id)
{
return me.db.Get<Person>(p => p.Id == id);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment