Example #1
0
        public async Task <List <GoodCellModel> > SearchCPUsGoodCells(CPUsSelector cpusSelector)
        {
            var normalParameters = _parametersCreator.GetCPUsParameters(cpusSelector)
                                   .Append(_parametersCreator.CreateDiscriminatorParameter <CPU>()).ToArray();
            var goodsDbInformation = await _context.GetGoodsDbInformation("GetCPUs", normalParameters);

            return(goodsDbInformation.GoodCells);
        }
Example #2
0
 public CPUsInformationSearcherFactory(IGoodsInformationSearcher goodsInformationSearcher,
                                       IGoodCellsSearcher goodCellsSearcher,
                                       ICacheKeyCreator keyCreator,
                                       CPUsSelector cpusSelector)
 {
     _goodsInformationSearcher = goodsInformationSearcher;
     _goodCellsSearcher        = goodCellsSearcher;
     _keyCreator   = keyCreator;
     _cpusSelector = cpusSelector;
 }
Example #3
0
        public async Task <GoodsInformation <string> > SearchCPUsInformation(CPUsSelector cpusSelector)
        {
            var normalParameters = _parametersCreator.GetCPUsParameters(cpusSelector)
                                   .Append(_parametersCreator.CreateDiscriminatorParameter <CPU>()).ToArray();
            var goodsDbInformation = await _context.GetGoodsDbInformation("GetCPUs", normalParameters);

            var questions = _questionsGrouper.GroupCPUs(cpusSelector, goodsDbInformation.DBQuestions);

            return(new GoodsInformation <string>(_parametersCreator.GetCount(normalParameters), goodsDbInformation.GoodCells, questions));
        }
Example #4
0
        public List <QuestionsBase <string> > GroupCPUs(CPUsSelector cpusSelector, List <DBQuestionBase> dBQuestions)
        {
            var questions = new List <QuestionsBase <string> >()
            {
                _questionsCreator.GroupCPUSocketTypes(dBQuestions),
                _questionsCreator.GroupThermalDesignPowers(dBQuestions),
                _questionsCreator.GroupNumberOfCores(dBQuestions),
                _questionsCreator.GroupNumberOfThreads(dBQuestions),
            };

            questions.AddRange(GroupComputerParts(cpusSelector, dBQuestions));
            return(questions);
        }
        public List <SqlParameter> GetCPUsParameters(CPUsSelector cpusSelector)
        {
            List <SqlParameter> sqlParameters = new List <SqlParameter>();

            sqlParameters.AddRange(GetComputerPartsParameters(cpusSelector));
            if (cpusSelector.CPUSocketTypes != null)
            {
                sqlParameters.Add(CreateCPUSocketTypesParameter(cpusSelector.CPUSocketTypes));
            }
            if (cpusSelector.ThermalDesignPowers != null)
            {
                sqlParameters.Add(CreateThermalDesignPowersParameter(cpusSelector.ThermalDesignPowers));
            }
            if (cpusSelector.NumberOfCores != null)
            {
                sqlParameters.Add(CreateNumberOfCoresParameter(cpusSelector.NumberOfCores));
            }
            if (cpusSelector.NumberOfThreads != null)
            {
                sqlParameters.Add(CreateNumberOfThreadsParameter(cpusSelector.NumberOfThreads));
            }
            return(sqlParameters);
        }
 public async Task <GoodsInformation <string> > GetCPUsInformation([FromBody] CPUsSelector cpusSelector)
 {
     return(await _goodsInformationCreator.CreateGoodsInformation(cpusSelector, new CPUsInformationSearcherFactory(_goodsInformationSearcher, _goodCellsSearcher, _keyCreator, cpusSelector)));
 }