コード例 #1
0
        public static bool IsAssociatedWithRooms(int officeId, IService service)
        {
            ConfigurationRepository roomRepository = RepositoryFactory.GetConfigurationRepository <Room>(service);
            var allRooms = roomRepository.GetAll <Room>();

            foreach (Room room in allRooms)
            {
                if (room.OfficeId == officeId)
                {
                    return(true);
                }
            }
            return(false);
        }
コード例 #2
0
        public void GetAll()
        {
            // Arrange
            ConfigurationRepository repository = new ConfigurationRepository();

            // Act
            Configurations result = repository.GetAll(100000, 0);

            // Assert
            Assert.IsNotNull(result);

            Assert.IsNotNull(result.configurations);

            int count = 0;

            foreach (Configuration c in result.configurations)
            {
                count++;
            }
            Assert.AreEqual(count, 2);
        }
コード例 #3
0
 public IActionResult GetAll()
 {
     var list = _repoConfiguration.GetAll();
     return Ok(list);
 }
コード例 #4
0
 public List <Configuration> GetAll()
 {
     return(_configRepository.GetAll());
 }