Beispiel #1
0
        public int AddTest(TestDto newTestDto)
        {
            Test test = new Test();
            newTestDto.ToTest(test);
            try
            {
                _testRepository.UpdateAndCommit(test);
                _unitOfWork.SaveChanges();

                return test.Id;
            }
            catch (Exception ex)
            {
                _logger.Log(ex);
                throw ex;
            }
        }
Beispiel #2
0
        public void UpdateTest(TestDto newTestDto)
        {
            Test test = new Test();
            newTestDto.ToTest(test);

            try
            {
                _testRepository.Update(test);
                _unitOfWork.SaveChanges();
            }
            catch (Exception ex)
            {
                _logger.Log(ex);
                throw ex;
            }
        }