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