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
public class PersonEvent | |
{ | |
[ForeignKey(typeof(Person))] | |
public int PersonId { get; set; } | |
[ForeignKey(typeof(Event))] | |
public int EventId { get; set; } | |
} |
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<Person>(); | |
db.CreateTable<Event>(); | |
db.CreateTable<PersonEvent>(); | |
var event1 = new Event | |
{ | |
Name = "Volleyball", | |
Date = new DateTime(2017, 06, 18), | |
Place = "Sports hall" |
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
[Table("RegistrationCertificates")] | |
public class RegistrationCertificate | |
{ | |
[PrimaryKey, AutoIncrement] | |
public int Id { get; set; } | |
public string RegistrationNumber { get; set; } | |
public string VIN { get; set; } |
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
[Table("Vehicles")] | |
public class Vehicle | |
{ | |
[PrimaryKey, AutoIncrement] | |
public int Id { get; set; } | |
public string Brand { get; set; } | |
public DateTime ProductionDate { get; set; } |
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) | |
}; |
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
[Table("RegistrationCertificates")] | |
public class RegistrationCertificate | |
{ | |
[PrimaryKey, AutoIncrement] | |
public int Id { get; set; } | |
public string RegistrationNumber { get; set; } | |
public string VIN { get; set; } |
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
[Table("Employees")] | |
public class Employee | |
{ | |
[PrimaryKey, AutoIncrement] | |
public int Id { get; set; } | |
public string Name { get; set; } | |
public string LastName { get; set; } | |
[OneToMany] |
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
[Table("Duties")] | |
public class Duty | |
{ | |
[PrimaryKey, AutoIncrement] | |
public int Id { get; set; } | |
public string Description { get; set; } | |
public DateTime Deadline { get; set; } |
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<Employee>(); | |
db.CreateTable<Duty>(); | |
var employee = new Employee | |
{ | |
Name = "Andrew", | |
LastName = "Programmer" | |
}; |
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
[Table("Duties")] | |
public class Duty | |
{ | |
[PrimaryKey, AutoIncrement] | |
public int Id { get; set; } | |
public string Description { get; set; } | |
public DateTime Deadline { get; set; } |