Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var db = new SQLiteConnection(new SQLitePlatformAndroid(), Constants.DbFilePath);
db.CreateTable<Employee>();
db.CreateTable<Duty>();
var employee = new Employee
{
Name = "Andrew",
LastName = "Programmer"
};
var duty1 = new Duty()
{
Description = "Project A Management",
Deadline = new DateTime(2017, 10, 31)
};
var duty2 = new Duty()
{
Description = "Reporting work time",
Deadline = new DateTime(2022, 12, 31)
};
db.Insert(employee);
db.Insert(duty1);
db.Insert(duty2);
employee.Duties = new List<Duty> {duty1, duty2};
db.UpdateWithChildren(employee);
var employeeStored = db.GetWithChildren<Employee>(employee.Id);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment