Exemple #1
0
        public async Task <ProductionLine> GetProductionLineById(Guid id)
        {
            ProductionLine ProductionLine = await _productionLineRepository.GetById(id);

            if (ProductionLine == null)
            {
                throw new KeyNotFoundException();
            }
            return(ProductionLine);
        }
Exemple #2
0
        public async Task <CompleteMaintenanceResult> CompleteMaintenance(Guid productionLineId)
        {
            var getProductionLineResult = await productionLineRepository.GetById(new ProductionLineId(productionLineId));

            var result = await getProductionLineResult.Match <Task <CompleteMaintenanceResult> >(
                async success => await ExecuteCompleteMaintenance(success.Result),
                async notFound => await Task.FromResult <CompleteMaintenanceResult>(new CompleteMaintenanceResult.NotFound()),
                async notReachablereachable => await Task.FromResult <CompleteMaintenanceResult>(new CompleteMaintenanceResult.NotReachable()),
                async error => await Task.FromResult <CompleteMaintenanceResult>(new CompleteMaintenanceResult.Error(error.Exception)));

            return(result);
        }
Exemple #3
0
        public Task <GetByIdResult <Domain.Production.ProductionLine> > GetById(Guid productionLineId)
        {
            var result = productionLineRepository.GetById(new ProductionLineId(productionLineId));

            return(result);
        }
Exemple #4
0
        public async Task <OutProductionLineDTO> GetProductionLineByIdAsync(int id)
        {
            var productionLine = await _productionLineRepository.GetById(id);

            return(ProductionLineMapping.ProductionLineToOutDTO(productionLine));
        }