예제 #1
0
        public Toy Add(string toy, Child child)
        {
            // Insert into DB
            int newToyId = _db.Insert($"INSERT INTO toy VALUES (null, '{toy}', {child.id})");

            // Create new toy instance
            Toy newToy = new Toy()
            {
                id    = newToyId,
                name  = toy,
                child = child
            };

            // Add to private collection
            _toys.Add(newToy);

            return(newToy);
        }
예제 #2
0
 public void RevokeToy(Toy toy, Child kid)
 {
     _db.Delete($"DELETE FROM Toys WHERE Id = {toy.Id}");
 }
예제 #3
0
 public void RevokeToy(Child kid, Toy toy)
 {
 }
 public void RevokeToy(Toy toy)
 {
     _toys.Remove(toy);
 }