Last active
May 21, 2017 10:17
-
-
Save dsibinski/c04bd7030750a87ab3898621612eca03 to your computer and use it in GitHub Desktop.
This file contains hidden or 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<Vehicle>(); | |
db.CreateTable<RegistrationCertificate>(); | |
var vehicle = new Vehicle | |
{ | |
Brand = "Renault", | |
EngineCapacity = 1.9m, | |
ProductionDate = new DateTime(2001, 01, 01) | |
}; | |
var certificate = new RegistrationCertificate | |
{ | |
RegistrationNumber = "AB 12345", | |
OwnerData = "Dawid Sibiński", | |
VIN = "1312BS1312ASDSSVVW" | |
}; | |
db.Insert(vehicle); | |
db.Insert(certificate); | |
vehicle.RegistrationCertificate = certificate; | |
db.UpdateWithChildren(vehicle); | |
var vehicleStored = db.GetWithChildren<Vehicle>(vehicle.Id); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment