public ComponentController(Startup.DeleteByIdResolver deleteAccesor, IComponentReadOnlyRepository readComponent, ICreate <Component> createComponent, IUpdate <Component> updateComponent) { delete = new DeleteComponent(deleteAccesor(WebApi.DeletesID.Component), readComponent); create = new CreateComponent(createComponent, readComponent); update = new UpdateComponent(updateComponent, readComponent); read = new ReadComponent(readComponent); }
public ComponentReplacer(Computer computer, Component component, IComponentReadOnlyRepository componentRepository, IFactoryCompatibility compatibilities, IFactoryEnough enoughs) { this.compatibilities = compatibilities; this.enoughs = enoughs; this.computer = computer; this.component = component; components = componentRepository.All.Where(c => c.TypePart == component.TypePart) .Where(c => c.IsEnough(enoughs[Enough.Level], GetLevelToReplace(component))) .Where(c => c.Id != component.Id) .OrderBy(c => c.Price); replaces = new Dictionary <TypePart, Func <Component> > { { TypePart.cpu, ReplaceCpu }, { TypePart.mother, ReplaceMother }, { TypePart.fan, ReplaceFan }, { TypePart.ram, ReplaceRam }, { TypePart.gpu, ReplaceGpu }, { TypePart.hdd, ReplaceCapacity }, { TypePart.ssd, ReplaceCapacity }, { TypePart.tower, ReplaceTower }, { TypePart.psu, ReplaceCapacity }, { TypePart.accesory, ReplaceAccesory } }; }
public BuilderComputer(IStrategyOrderBy orderBy, IFactoryCompatibility factoryCompatibility, IFactoryEnough factoryEnough, IComponentReadOnlyRepository componentRepo, ICostsReadOnlyRepository costRepo) { this.orderBy = orderBy; this.factoryCompatibility = factoryCompatibility; this.factoryEnough = factoryEnough; repository = componentRepo; buildCost = costRepo.BuildCost; pricePerfomanceMultiplier = costRepo.PricePerfomanceMultiplier; }
public RegisterBuildError(IComponentReadOnlyRepository componenRepository, IFactoryCompatibility compatibilities, IFactoryEnough enoughs, IErrorBuildingWriteOnlyRepository errorRepository, IErrorBuildingWithReplaceWriteOnlyRepository errorReplaceRepository, IComputerReadOnlyRepository computerRepository) { this.componenRepository = componenRepository; this.compatibilities = compatibilities; this.enoughs = enoughs; this.errorRepository = errorRepository; this.errorReplaceRepository = errorReplaceRepository; this.computerRepository = computerRepository; }
public ComputerStockRepository(IComponentReadOnlyRepository componentRepository) { ComponentRepository = componentRepository; }
public DeleteComponent(IDeleteById delete, IComponentReadOnlyRepository read) { this.delete = delete; this.read = read; }
public ComputerReadOnlyRepository(IConnection connection, IComponentReadOnlyRepository componentRepository, ICostsReadOnlyRepository costRepo) : base(connection) { this.componentRepository = componentRepository; this.costRepo = costRepo; }
public UpdateComponent(IUpdate <Component> update, IComponentReadOnlyRepository read) { this.update = update; this.read = read; }
public CreateComponent(ICreate <Component> create, IComponentReadOnlyRepository read) { this.create = create; this.read = read; }
public ReadComponent(IComponentReadOnlyRepository read) { this.read = read; }
public ControlStock(IComponentReadOnlyRepository componentRepo) { this.componentRepo = componentRepo; }