Example #1
0
        private void InstantiateGlobalObjects()
        {
            AdoClientService = new AdoClientService(EnvironmentContext.PlatformConnection);

            var resultSets = AdoClientService.GetMultiResultSets();

            var result = resultSets.SingleOrDefault(x => x.Item1.Equals("countrycode"));

            CountryService = new CountryService((List <string>)result.Item2);

            result = resultSets.SingleOrDefault(x => x.Item1.Equals("locationabbreviation"));
            LocationAbbreviationService = new LocationAbbreviationService((List <LocationAbbreviation>)result.Item2);

            result = resultSets.SingleOrDefault(x => x.Item1.Equals("locationcleanserdirective"));
            LocationCleanserService = new LocationCleanserService((List <LocationCleanserDirective>)result.Item2);

            result = resultSets.SingleOrDefault(x => x.Item1.Equals("locationsuggestioninput"));
            var result2 = resultSets.SingleOrDefault(x => x.Item1.Equals("charactertransformation"));

            LocationSuggestionInputService = new LocationSuggestionInputService((List <LocationSuggestionInput>)result.Item2, (List <CharacterTransformation>)result2.Item2);

            XmlDataService = new XmlDataService();

            result  = resultSets.SingleOrDefault(x => x.Item1.Equals("preferredlocationnameselection"));
            result2 = resultSets.SingleOrDefault(x => x.Item1.Equals("locationname"));
            PreferredLocationNameService = new PreferredLocationNameService((List <PreferredLocationNameSelection>)result.Item2, (List <LocationName>)result2.Item2);

            DuplicateSuggestionOutputResolverService = new DuplicateSuggestionOutputResolverService();
        }
        static void Main(string[] args)
        {
            var adoClientService = new AdoClientService();
            var esClient         = new ElasticClientService();

            //PopulateUniqueNames();
            //PerformFormattedNameAnalysis(adoClientService);
            //SetFormattingCodesForDuplicateNames(adoClientService);
            ResolveDuplicateMappings(adoClientService);
            //MissingLocationAnalyzer(adoClientService, esClient);
            Console.ReadLine();
        }
        private static void PopulateUniqueNames()
        {
            var adoClientService = new AdoClientService();
            var namingService    = new NamingService(adoClientService);

            var countryCodes = adoClientService.GetCountryCodes();

            foreach (var countryCode in countryCodes)
            {
                namingService.SetUniqueNames("en", countryCode);
            }
        }
        private static void SetFormattingCodesForDuplicateNames(AdoClientService adoClientService)
        {
            var formattingService = new FormatSettingService(adoClientService);

            formattingService.Configure();
        }
        private static void PerformFormattedNameAnalysis(AdoClientService adoClientService)
        {
            var namesService = new NamesService(adoClientService);

            namesService.Analyze();
        }
        private static void ResolveDuplicateMappings(AdoClientService adoClientService)
        {
            var resolver = new DuplicateLocationMappingResolver(adoClientService);

            resolver.Resolve();
        }
        private static void MissingLocationAnalyzer(AdoClientService adoClientService, ElasticClientService esClient)
        {
            var analyzer = new MissingLocationsIdentifier(adoClientService, esClient);

            analyzer.Process();
        }