internal Enumerator(IEnumerable <ManagementObject> collection, DComConnection connection,
                                IWqlQuery queryObject, Type outType)
            {
                if (queryObject == null && outType == null)
                {
                    throw new ArgumentException(
                              $"Both {nameof(queryObject)} and {nameof(outType)} cannot be null at the same time.");
                }

                _connection           = connection;
                _collection           = collection.GetEnumerator();
                _queryObject          = queryObject;
                _connectionExpression = Expression.Constant(connection);
                _outType = outType;
            }
 public ObjectReader(IEnumerable collection, DComConnection connection, IWqlQuery queryObject,
                     Type outType = null)
 {
     _enumerator = new Enumerator(collection.Cast <ManagementObject>(), connection, queryObject, outType);
 }