public async Task <ActionResult> CompleteMaintenance(Guid productionLineId) { var shutDownResult = await CompleteMaintenanceCommandHandler.CompleteMaintenance(productionLineId); return(shutDownResult.Match( success => NoContent(), notAvailable => this.CanNotExecute(), notFound => this.Problem(ProblemFactory.EntityNotFound(typeof(ProductionLineHto).Name, productionLineId.ToString())), notReachable => this.Problem(ProblemFactory.ServiceUnavailable()), error => this.Problem(ProblemFactory.Exception(error.Exception)))); }
public ProductionLineController( GetByIdCommandHandler getByIdCommandHandler, ShutDownForMaintenanceCommandHandler shutDownForMaintenanceCommandHandler, CompleteMaintenanceCommandHandler completeMaintenanceCommandHandler, IProblemFactory problemFactory) { GetByIdCommandHandler = getByIdCommandHandler; ShutDownForMaintenanceCommandHandler = shutDownForMaintenanceCommandHandler; CompleteMaintenanceCommandHandler = completeMaintenanceCommandHandler; ProblemFactory = problemFactory; }