Пример #1
0
        public override void Load()
        {
            var mongoDb             = new MongoClient(Properties.Settings.Default.MongoConnection);
            var mongoConnection     = mongoDb.GetDatabase(Properties.Settings.Default.DatabaseName);
            var masterConfiguration = ConfigurationManager.GetCurrentConfiguration(Properties.Settings.Default.MasterConfigLocation);
            var baseHostString      = ApiUrlBuilder.BuildApiStaticDataUrl(Regions.euw, masterConfiguration);

            Bind <IRepositoryFactory>().To <RepositoryFactory>().WithConstructorArgument(mongoConnection);
            Bind <IProcessingStrategyFactory>().To <ProcessingStrategyFactory>();
            Bind <IQueryExecutor>().To <QueryExecutor>().WithConstructorArgument(new HttpClient());
            Bind <IQueryBuilder>().To <QueryBuilder>()
            .WithConstructorArgument("apiKey", Properties.Settings.Default.ApiKey)
            .WithConstructorArgument("host", baseHostString);
        }
Пример #2
0
        static void Main()
        {
            var          config      = ConfigurationManager.GetCurrentConfiguration(ConfigFileLocation);
            IMongoClient mongoClient = new MongoClient("mongodb://*****:*****@spirital.tk:1801");
            var          database    = mongoClient.GetDatabase("LeagueComparer");
            var          repoFactory = new RepositoryFactory(database);
            var          strategyProcessingFactory = new ProcessingStrategyFactory(repoFactory);

            var queryBuilder  = new QueryBuilder(config.ApiKey, ApiUrlBuilder.BuildApiStaticDataUrl(Regions.euw, config));
            var championQuery = queryBuilder.BuildQuery(ObjectType.Champion, new QueryParameter("champData", "all"));

            var queryExecutor              = new QueryExecutor();
            var championQueryResponse      = queryExecutor.ExecuteQuery(championQuery).Result;
            var championProcessingStrategy = strategyProcessingFactory.GetProcessingStrategy(championQueryResponse.QueryObjectType);

            championProcessingStrategy.ProcessQueryResponse(championQueryResponse).Wait();
        }
Пример #3
0
 public GetSpellCostTypes(HttpClient apiQueryExecutor, Config currentConfiguration)
     : base(apiQueryExecutor, currentConfiguration)
 {
     this.apiEndpoint = ApiUrlBuilder.BuildApiStaticDataUrl(Regions.euw, this.currentConfiguration);
     this.apiMethod   = ApiMethod;
 }
Пример #4
0
 public RuneTypes(HttpClient httpClient, Config currentConfiguration)
     : base(httpClient, currentConfiguration)
 {
     this.apiEndpoint = ApiUrlBuilder.BuildApiStaticDataUrl(Regions.euw, currentConfiguration);
     this.apiMethod   = ApiMethod;
 }
 public ChampionResourcesAnalyser(HttpClient apiQueryExecutor, Config currentConfiguration)
     : base(apiQueryExecutor, currentConfiguration)
 {
     this.apiEndpoint = ApiUrlBuilder.BuildApiStaticDataUrl(Regions.euw, currentConfiguration);
     this.apiMethod   = ApiMethod;
 }