Ejemplo n.º 1
0
        /// <summary>
        /// Removes the results of passing tests from the user.
        /// </summary>
        /// <param name="userId">User id</param>
        public void DeleteUserResults(int userId)
        {
            var userResults = testResultRepository.GetAllByPredicate(r => r.UserId == userId);

            foreach (var userResult in userResults)
            {
                testResultRepository.Delete(userResult);
            }
        }
Ejemplo n.º 2
0
        public async Task <DeletedTestResultDto> DeleteTestResult(int testResultId)
        {
            TestResult testResult = await testResultRepository.GetByIdAsync(testResultId);

            if (testResult == null)
            {
                return(null);
            }

            testResultRepository.Delete(testResult);
            await unitOfWork.SaveAsync();

            return(mapper.Map <DeletedTestResultDto>(testResult));
        }
 /// <summary>
 /// Deletes test results
 /// </summary>
 /// <param name="entity">Test result</param>
 public void Delete(BllTestResult entity)
 {
     testResultRepository.Delete(entity.ToDalTestResult());
     unitOfWork.Commit();
 }