public async Task <List <GoodCellModel> > SearchComputerDrivesGoodCells(ComputerDrivesSelector computerDrivesSelector) { var normalParameters = _parametersCreator.GetComputerDrivesParameters(computerDrivesSelector) .Append(_parametersCreator.CreateDiscriminatorParameter <ComputerDrive>()).ToArray(); var goodsDbInformation = await _context.GetGoodsDbInformation("GetComputerDrives", normalParameters); return(goodsDbInformation.GoodCells); }
public ComputerDrivesInformationSearcherFactory(IGoodsInformationSearcher goodsInformationSearcher, IGoodCellsSearcher goodCellsSearcher, ICacheKeyCreator keyCreator, ComputerDrivesSelector computerDrivesSelector) { _goodsInformationSearcher = goodsInformationSearcher; _goodCellsSearcher = goodCellsSearcher; _keyCreator = keyCreator; _computerDrivesSelector = computerDrivesSelector; }
public List <QuestionsBase <string> > GroupComputerDrives(ComputerDrivesSelector computerDrivesSelector, List <DBQuestionBase> dBQuestions) { var questions = new List <QuestionsBase <string> >() { _questionsCreator.GroupCapacity(dBQuestions), _questionsCreator.GroupComputerDriveTypes(dBQuestions), _questionsCreator.GroupFormFactorTypes(dBQuestions), }; questions.AddRange(GroupComputerParts(computerDrivesSelector, dBQuestions)); return(questions); }
public List <SqlParameter> GetComputerDrivesParameters(ComputerDrivesSelector computerDrivesSelector) { List <SqlParameter> sqlParameters = new List <SqlParameter>(); sqlParameters.AddRange(GetComputerPartsParameters(computerDrivesSelector)); if (computerDrivesSelector.Capacities != null) { sqlParameters.Add(CreateCapacitiesParameter(computerDrivesSelector.Capacities)); } if (computerDrivesSelector.Types != null) { sqlParameters.Add(CreateComputerDriveTypesParameter(computerDrivesSelector.Types)); } if (computerDrivesSelector.FormFactorTypes != null) { sqlParameters.Add(CreateFormFactorTypesParameter(computerDrivesSelector.FormFactorTypes)); } return(sqlParameters); }
public async Task <GoodsInformation <string> > SearchComputerDrivesInformation(ComputerDrivesSelector computerDrivesSelector) { var normalParameters = _parametersCreator.GetComputerDrivesParameters(computerDrivesSelector) .Append(_parametersCreator.CreateDiscriminatorParameter <ComputerDrive>()).ToArray(); var goodsDbInformation = await _context.GetGoodsDbInformation("GetComputerDrives", normalParameters); var questions = _questionsGrouper.GroupComputerDrives(computerDrivesSelector, goodsDbInformation.DBQuestions); return(new GoodsInformation <string>(_parametersCreator.GetCount(normalParameters), goodsDbInformation.GoodCells, questions)); }
public async Task <GoodsInformation <string> > GetComputerDrivesInformation([FromBody] ComputerDrivesSelector computerDrivesSelector) { return(await _goodsInformationCreator.CreateGoodsInformation(computerDrivesSelector, new ComputerDrivesInformationSearcherFactory(_goodsInformationSearcher, _goodCellsSearcher, _keyCreator, computerDrivesSelector))); }