Exemplo n.º 1
0
        public void Contains(string value, bool caseSensitive = false)
        {
            if (!string.IsNullOrEmpty(value))
            {
                StatementPattern pattern = new StatementPattern(this.Uri, null, value).Contains(value, caseSensitive);

                WhereStatements.Add(pattern);
            }
        }
Exemplo n.º 2
0
        public StatementPattern Where(Property property, IEnumerable <object> objects)
        {
            if (objects == null)
            {
                throw new ArgumentNullException("objects");
            }

            StatementPattern pattern = null;

            foreach (object o in objects)
            {
                pattern = Where(property, o);
            }

            return(pattern);
        }
Exemplo n.º 3
0
        public StatementPattern Where(Property property, object value = null)
        {
            if (value is ResourceQuery)
            {
                ResourceQuery query = value as ResourceQuery;
                query.DependentQueries.Add(this);
                this.DependentQueries.Add(query);
            }

            StatementPattern pattern;

            if (property != null)
            {
                if (value != null)
                {
                    pattern = new StatementPattern(this.Uri, property.Uri, value);
                }
                else
                {
                    pattern = new StatementPattern(this.Uri, property.Uri, null);
                }
            }
            else
            {
                if (value != null)
                {
                    pattern = new StatementPattern(this.Uri, null, value);
                }
                else
                {
                    throw new ArgumentException(string.Format("Error: Invalid arguments {0} {1}.", property, value));
                }
            }

            WhereStatements.Add(pattern);

            return(pattern);
        }