public async Task <List <GoodCellModel> > SearchHeadphonesGoodCells(HeadphonesSelector headphonesSelector) { var normalParameters = _parametersCreator.GetHeadphonesParameters(headphonesSelector) .Append(_parametersCreator.CreateDiscriminatorParameter <Headphones>()).ToArray(); var goodsDbInformation = await _context.GetGoodsDbInformation("GetHeadphones", normalParameters); return(goodsDbInformation.GoodCells); }
public async Task <GoodsInformation <string> > SearchHeadphonesInformation(HeadphonesSelector headphonesSelector) { var normalParameters = _parametersCreator.GetHeadphonesParameters(headphonesSelector) .Append(_parametersCreator.CreateDiscriminatorParameter <Headphones>()).ToArray(); var goodsDbInformation = await _context.GetGoodsDbInformation("GetHeadphones", normalParameters); var questions = _questionsGrouper.GroupHeadphones(headphonesSelector, goodsDbInformation.DBQuestions); return(new GoodsInformation <string>(_parametersCreator.GetCount(normalParameters), goodsDbInformation.GoodCells, questions)); }
public HeadphonesInformationSearcherFactory(IGoodsInformationSearcher goodsInformationSearcher, IGoodCellsSearcher goodCellsSearcher, ICacheKeyCreator keyCreator, HeadphonesSelector headphonesSelector) { _goodsInformationSearcher = goodsInformationSearcher; _goodCellsSearcher = goodCellsSearcher; _keyCreator = keyCreator; _headphonesSelector = headphonesSelector; }
public List <QuestionsBase <string> > GroupHeadphones(HeadphonesSelector headphonesSelector, List <DBQuestionBase> dBQuestions) { var questions = new List <QuestionsBase <string> >() { _questionsCreator.GroupHeadphonesTypes(dBQuestions), _questionsCreator.GroupWirelessTypes(dBQuestions), _questionsCreator.GroupConnectorTypes(dBQuestions), }; questions.AddRange(GroupComputerAccessories(headphonesSelector, dBQuestions)); return(questions); }
public List <SqlParameter> GetHeadphonesParameters(HeadphonesSelector HeadphonesSelector) { List <SqlParameter> sqlParameters = new List <SqlParameter>(); sqlParameters.AddRange(GetComputerAccessoriesParameters(HeadphonesSelector)); if (HeadphonesSelector.Types != null) { sqlParameters.Add(CreateHeadphonesTypesParameter(HeadphonesSelector.Types)); } if (HeadphonesSelector.WirelessTypes != null) { sqlParameters.Add(CreateWirelessTypesParameter(HeadphonesSelector.WirelessTypes)); } if (HeadphonesSelector.ConnectorTypes != null) { sqlParameters.Add(CreateConnectorTypesParameter(HeadphonesSelector.ConnectorTypes)); } return(sqlParameters); }
public async Task <GoodsInformation <string> > GetHeadphonesInformation([FromBody] HeadphonesSelector headphonesSelector) { return(await _goodsInformationCreator.CreateGoodsInformation(headphonesSelector, new HeadphonesInformationSearcherFactory(_goodsInformationSearcher, _goodCellsSearcher, _keyCreator, headphonesSelector))); }