static void Main(string[] args) { var addressProvider = new AddressProviderTool(); int postCode; if (!int.TryParse(args[0], out postCode)) { Console.WriteLine("Usage: ConsoleClient [postCode]"); } List<Person> resultList = addressProvider.getPersonList(postCode); WriteResultToFile(String.Format("result{0}_Full.txt", postCode), resultList); var filteredResultList = FilterManager.GetFilteredPersonList(resultList, new List<IPersonFilter> { new ScandinavianSurname(), }); WriteResultToFile(String.Format("result{0}_Scand.txt", postCode), filteredResultList); filteredResultList = FilterManager.GetFilteredPersonList(resultList, new List<IPersonFilter> { new ScandinavianSurname(), new NonPolishSurnameNonExactName() }); WriteResultToFile(String.Format("result{0}_NonExact.txt", postCode), filteredResultList); filteredResultList = FilterManager.GetFilteredPersonList(resultList, new List<IPersonFilter> { new ScandinavianSurname(), new NonPolishSurname() }); WriteResultToFile(String.Format("result{0}_Polish.txt", postCode), filteredResultList); }
public PersonsController(ITerritoryDb db, IAddressProvider addressProvider) { _db = db; _addresProviderTool = new AddressProviderTool(addressProvider); }