Exemple #1
0
        public async Task <IActionResult> DeleteTestRunOutputByTestRunIdAsync([FromBody] Guid id)
        {
            var entityToBeRemoved = (await _meissaRepository.GetAllQueryWithRefreshAsync <TestRunOutput>()).FirstOrDefault(x => x.TestRunId.Equals(id));

            if (entityToBeRemoved != null)
            {
                await _meissaRepository.DeleteWithSaveAsync(entityToBeRemoved);
            }

            return(NoContent());
        }
Exemple #2
0
        public async Task <IActionResult> DeleteOldTestRunDataByTestRunIdAsync([FromBody] Guid id)
        {
            try
            {
                var testRun = _meissaRepository.GetAllQuery <TestRun>().FirstOrDefault(r => r.TestRunId.Equals(id));
                if (testRun != null)
                {
                    var testRunOutputs = _meissaRepository.GetAllQuery <TestRunOutput>().Where(x => x.TestRunId.Equals(testRun.TestRunId));
                    _meissaRepository.DeleteRange(testRunOutputs);
                    var testRunCustomArguments = _meissaRepository.GetAllQuery <TestRunCustomArgument>().Where(x => x.TestRunId.Equals(testRun.TestRunId));
                    _meissaRepository.DeleteRange(testRunCustomArguments);
                    var testAgentRuns = _meissaRepository.GetAllQuery <TestAgentRun>().Where(x => x.TestRunId.Equals(testRun.TestRunId));
                    DeleteTestAgentRunAvailabilitiesForTestAgentRuns(testAgentRuns);
                    _meissaRepository.DeleteRange(testAgentRuns);
                    var testRunLogs = _meissaRepository.GetAllQuery <TestRunLog>().Where(x => x.TestRunId.Equals(testRun.TestRunId));
                    _meissaRepository.DeleteRange(testRunLogs);
                    var testRunAvailabilities = _meissaRepository.GetAllQuery <TestRunAvailability>().Where(x => x.TestRunId.Equals(testRun.TestRunId));
                    _meissaRepository.DeleteRange(testRunLogs);
                    await _meissaRepository.DeleteWithSaveAsync(testRun);

                    await _meissaRepository.SaveAsync();
                }
            }
            catch (DbUpdateConcurrencyException ex)
            {
                // Ignore.
            }

            return(NoContent());
        }
Exemple #3
0
        public async Task <IActionResult> DeleteTestRunAvailabilityAsync([FromBody] int id)
        {
            var entityToBeRemoved = await _meissaRepository.GetByIdAsync <TestRunAvailability>(id);

            if (entityToBeRemoved == null)
            {
                return(NotFound());
            }

            await _meissaRepository.DeleteWithSaveAsync(entityToBeRemoved);

            return(NoContent());
        }
Exemple #4
0
        public async Task <IActionResult> DeleteTestAgentAsync([FromBody] int id)
        {
            var entityToBeRemoved = await _meissaRepository.GetByIdAsync <TestAgent>(id).ConfigureAwait(false);

            if (entityToBeRemoved == null)
            {
                return(NotFound());
            }

            await _meissaRepository.DeleteWithSaveAsync(entityToBeRemoved).ConfigureAwait(false);

            return(NoContent());
        }
        public async Task <IActionResult> DeleteTestRun([FromBody] Guid id)
        {
            var entityToBeRemoved = (await _meissaRepository.GetAllQueryWithRefreshAsync <TestRun>().ConfigureAwait(false)).FirstOrDefault(x => x.TestRunId.Equals(id));

            if (entityToBeRemoved == null)
            {
                return(NotFound());
            }

            await _meissaRepository.DeleteWithSaveAsync(entityToBeRemoved).ConfigureAwait(false);

            return(NoContent());
        }