public async Task <List <GoodCellModel> > SearchCoolersGoodCells(CoolersSelector coolersSelector) { var normalParameters = _parametersCreator.GetCoolersParameters(coolersSelector) .Append(_parametersCreator.CreateDiscriminatorParameter <Cooler>()).ToArray(); var goodsDbInformation = await _context.GetGoodsDbInformation("GetCoolers", normalParameters); return(goodsDbInformation.GoodCells); }
public CoolersInformationSearcherFactory(IGoodsInformationSearcher goodsInformationSearcher, IGoodCellsSearcher goodCellsSearcher, ICacheKeyCreator keyCreator, CoolersSelector coolersSelector) { _goodsInformationSearcher = goodsInformationSearcher; _goodCellsSearcher = goodCellsSearcher; _keyCreator = keyCreator; _coolersSelector = coolersSelector; }
public async Task <GoodsInformation <string> > SearchCoolersInformation(CoolersSelector coolersSelector) { var normalParameters = _parametersCreator.GetCoolersParameters(coolersSelector) .Append(_parametersCreator.CreateDiscriminatorParameter <Cooler>()).ToArray(); var goodsDbInformation = await _context.GetGoodsDbInformation("GetCoolers", normalParameters); var questions = _questionsGrouper.GroupCoolers(coolersSelector, goodsDbInformation.DBQuestions); return(new GoodsInformation <string>(_parametersCreator.GetCount(normalParameters), goodsDbInformation.GoodCells, questions)); }
public List <QuestionsBase <string> > GroupCoolers(CoolersSelector coolersSelector, List <DBQuestionBase> dBQuestions) { var questions = new List <QuestionsBase <string> >() { _questionsCreator.GroupCoolerTypes(dBQuestions), _questionsCreator.GroupFanSizes(dBQuestions), }; questions.AddRange(GroupComputerParts(coolersSelector, dBQuestions)); return(questions); }
public List <SqlParameter> GetCoolersParameters(CoolersSelector coolersSelector) { List <SqlParameter> sqlParameters = new List <SqlParameter>(); sqlParameters.AddRange(GetComputerPartsParameters(coolersSelector)); if (coolersSelector.Types != null) { sqlParameters.Add(CreateCoolerTypesParameter(coolersSelector.Types)); } if (coolersSelector.FanSizes != null) { sqlParameters.Add(CreateFanSizesParameter(coolersSelector.FanSizes)); } return(sqlParameters); }
public async Task <GoodsInformation <string> > GetCoolersInformation([FromBody] CoolersSelector coolersSelector) { return(await _goodsInformationCreator.CreateGoodsInformation(coolersSelector, new CoolersInformationSearcherFactory(_goodsInformationSearcher, _goodCellsSearcher, _keyCreator, coolersSelector))); }