Created
May 18, 2017 20:47
-
-
Save dsibinski/4b8566aba0d8280aa5117de3f1ce70fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var db = new SQLiteConnection(new SQLitePlatformAndroid(), Constants.DbFilePath); | |
db.CreateTable<Person>(); | |
db.CreateTable<Event>(); | |
db.CreateTable<PersonEvent>(); | |
var event1 = new Event | |
{ | |
Name = "Volleyball", | |
Date = new DateTime(2017, 06, 18), | |
Place = "Sports hall" | |
}; | |
var person1 = new Person | |
{ | |
Name = "A", | |
LastName = "B", | |
PhoneNumber = "123456789" | |
}; | |
db.Insert(person1); | |
db.Insert(event1); | |
person1.Events = new List<Event> { event1 }; | |
db.UpdateWithChildren(person1); | |
var personStored = db.GetWithChildren<Person>(person1.Id); | |
var eventStored = db.GetWithChildren<Event>(event1.Id); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment