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); }
public void RevokeToy(Toy toy, Child kid) { _db.Delete($"DELETE FROM Toys WHERE Id = {toy.Id}"); }
public void RevokeToy(Child kid, Toy toy) { }
public void RevokeToy(Toy toy) { _toys.Remove(toy); }