コード例 #1
0
        public static List <SpaceEntity> GetAllSpaceDetailsWithFilter()
        {
            List <SpaceEntity>   resultList = new List <SpaceEntity>();
            DapperMySQLConnector p          = new DapperMySQLConnector();

            p.db = new MySqlConnection(MainWindow.DatabaseconnStringPoolingTrue);
            StringBuilder sb   = new StringBuilder();
            var           temp = p.GetAllSpaces();

            p.db.Close();

            //Alarm to select space with Filters
            var queryFilterSpaces = from space in temp
                                    where space.Name == "Space Name" ||
                                    space.Type == 0
                                    select space;

            //To display alarms
            foreach (var spaceVar in queryFilterSpaces)
            {
                SpaceEntity _space = (SpaceEntity)spaceVar;
                resultList.Add(_space);
            }

            return(resultList);
        }
コード例 #2
0
        public static List <SpaceEntity> GetAllSpaceDetails()
        {
            List <Space>         resultList = new List <Space>();
            DapperMySQLConnector p          = new DapperMySQLConnector();

            p.db = new MySqlConnection(MainWindow.DatabaseconnStringPoolingTrue);
            StringBuilder sb   = new StringBuilder();
            var           temp = p.GetAllSpaces();

            p.db.Close();
            return(temp);
        }