Exemplo n.º 1
0
        private async Task UpdatePipelineStages(Pipeline pipeline, IEnumerable <Stage> updatedStages)
        {
            for (int i = 0; i < pipeline.Stages.Count; i++)
            {
                var oldStage  = pipeline.Stages.ElementAt(i);
                var newStage  = updatedStages.ElementAt(i);
                var repoStage = await _stageRepository.FindOneByAsync(s => s.Id == oldStage.Id);

                for (int j = 0; j < repoStage.Jobs.Count; j++)
                {
                    repoStage.Jobs.ElementAt(j).Status = newStage.Jobs.ElementAt(j).Status;
                }
            }
        }