Skip to content
Permalink
add6e4d428
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
27 lines (23 sloc) 632 Bytes
using System.Collections.Generic;
using System.Threading.Tasks;
using SQLite;
namespace Local
{
public class Database
{
private readonly SQLiteAsyncConnection _database;
public Database(string dbPath)
{
_database = new SQLiteAsyncConnection(dbPath);
_database.CreateTableAsync<Person>().Wait();
}
public Task<List<Person>> GetPeopleAsync()
{
return _database.Table<Person>().ToListAsync();
}
public Task<int> SavePersonAsync(Person person)
{
return _database.InsertAsync(person);
}
}
}