示例#1
0
        public DataAccessService(TestContext testContext)
        {
            _elementRepository = new ElementRepository(testContext);

            if (_elementRepository.GetAllElements().Count() < 6)
            {
                _elementRepository.Add(new ElementDTO {
                    Code = "Test1", Name = "Name 1"
                });
                _elementRepository.Add(new ElementDTO {
                    Code = "Test2", Name = "Name 2"
                });
                _elementRepository.Add(new ElementDTO {
                    Code = "Test3", Name = "Name 3"
                });
                _elementRepository.Add(new ElementDTO {
                    Code = "Test4", Name = "test", Active = true
                });
                _elementRepository.Add(new ElementDTO {
                    Code = "Test5", Name = "test", Active = false
                });
                _elementRepository.Add(new ElementDTO {
                    Code = "Test6", Name = "Name 6", Active = true
                });
            }
        }
示例#2
0
 public IQueryable <ElementDTO> GetAllElements()
 {
     return(_elementRepository.GetAllElements());
 }