Beispiel #1
0
        private static void ReadFullPerson(SQLiteCrud sqlite, int id)
        {
            FullPersonModel person = sqlite.LoadFullPersonInfo(id);

            Console.WriteLine($"{person.Id}: {person.FirstName} {person.LastName}");
            foreach (var address in person.Addresses)
            {
                Console.WriteLine($"\t{address.Street} {address.City}");
            }
        }
Beispiel #2
0
        private static void SaveFullPerson(SQLiteCrud sqlite)
        {
            var addresses = new List <AddressModel>();

            addresses.Add(new AddressModel {
                Street = "Street1", City = "City1"
            });
            addresses.Add(new AddressModel {
                Street = "Street2", City = "City2"
            });
            var person = new FullPersonModel
            {
                FirstName = "Tim",
                LastName  = "Corey",
                Addresses = addresses
            };

            sqlite.SaveFullPerson(person);
        }