コード例 #1
0
        /// <summary>
        /// Provided wheres will be gathered
        /// </summary>
        /// <param name="informationType">Information type</param>
        /// <param name="where">Where statement</param>
        /// <returns>Returns this with wheres</returns>
        public IDeviceCollection Where(InformationType informationType, string where)
        {
            Setup(HasExecuted());
            Queries.Add(new Query(informationType, where));

            if (InformationTypes == null)
            {
                InformationTypes = new[] { informationType };
            }
            InformationTypes = InformationTypes.Concat(new[] { informationType }).Distinct().ToArray();

            return(this);
        }
コード例 #2
0
        /// <summary>
        /// Provided queries will be gathered
        /// </summary>
        /// <param name="queries">List of query object containing InformationType and a string with where statement</param>
        /// <returns>Returns this with queries</returns>
        public IDeviceCollection WithQueries(IEnumerable <Query> queries)
        {
            Setup(HasExecuted());
            Queries.AddRange(queries);

            foreach (var query in Queries)
            {
                if (InformationTypes == null)
                {
                    InformationTypes = new[] { query.InformationType };
                }
                InformationTypes = InformationTypes.Concat(new[] { query.InformationType }).Distinct().ToArray();
            }

            return(this);
        }