Exemplo n.º 1
0
 private static void CheckAFewPersons(IObjectContainer container, City city)
 {
     Random random = new Random();
     IList<Person> persons = container.Query<Person>();
     int personCount = persons.Count;
     for (int i = 0; i < 10; i++)
     {
         Person aPerson = persons[random.Next(personCount)];
         PrintCitizenStatus(city, aPerson);
     }
 }
Exemplo n.º 2
0
 private static void PrintCitizenStatus(City city, Person aPerson)
 {
     if (city.IsCitizen(aPerson))
     {
         Console.WriteLine(aPerson + " is a citizen");
     }
     else
     {
         Console.WriteLine(aPerson + " isn't a citizen");
     }
 }