Beispiel #1
0
        public TestSolutionDto CreateTestSolution([FromBody] TestSolutionDto testSolutionDto)
        {
            TestSolutionDto savedTestSolution = null;

            try
            {
                savedTestSolution = new TestSolutionsRepository(_appDbContext).SaveTestSolution(testSolutionDto);
            }
            catch (Exception e)
            {
                _log.LogError(e, "Error saving Test Solution");
            }
            return(savedTestSolution);
        }
Beispiel #2
0
        public TestSolutionDto SaveTestSolutionFeedback([FromBody] TestSolutionDto testSolution)
        {
            try
            {
                if (!ModelState.IsValid || testSolution.TestSolutionQuestions.Count() == 0)
                {
                    throw new Exception();
                }

                TestSolutionDto testSolutionDto = new TestSolutionsRepository(_appDbContext).SaveFeedback(testSolution);

                return(testSolutionDto);
            }
            catch (Exception e)
            {
                _log.LogError(e, "Error saving TestSolutionQuestions");
                return(null);
            }
        }