public IEnumerable <AdministratedTestBusiness> GetAdministratedTests() { _repo = new AdministratedTestRepository(); var administratedTests = _repo.GetAdministratedTests().Select(AdministratedTestMapper.MapDaoToDomain); return(administratedTests); }
public AdministratedTestBusiness GetAdministratedTest(int administratedTestId) { _repo = new AdministratedTestRepository(); AdministratedTestBusiness administratedTest = null; try { administratedTest = _repo.GetAdministratedTestById(administratedTestId); } catch (NullReferenceException ex) { //TODO } catch (ArgumentNullException ex) { //TODO } catch (Exception ex) { //TODO } return(administratedTest); }
public AdministratedTestService(AdministratedTestRepository repo) { if (repo is null) { _repo = new AdministratedTestRepository(); } else { _repo = repo; } }
public void DeleteAdministratedTest(int administratedTestId) { using (_repo = new AdministratedTestRepository()) { try { _repo.DeleteAdministratedTest(administratedTestId); } catch (NotSupportedException ex) { } catch (ObjectDisposedException ex) { } catch (InvalidOperationException ex) { } catch (Exception ex) { } } }
public AdministratedTestService() { _repo = new AdministratedTestRepository(); }