Esempio n. 1
0
        public override void WriteTo(StringBuilder writer)
        {
            if (IndexName == null && CollectionName == null)
            {
                throw new NotSupportedException("Either IndexName or CollectionName must be specified");
            }

            if (IsDynamic)
            {
                writer
                .Append("FROM ");
                if (CollectionName.IndexOfAny(_whiteSpaceChars) != -1)
                {
                    if (CollectionName.IndexOf('"') != -1)
                    {
                        ThrowInvalidcollectionName();
                    }
                    writer.Append('"').Append(CollectionName).Append('"');
                }
                else
                {
                    WriteField(writer, CollectionName);
                }

                return;
            }

            writer
            .Append("FROM INDEX '")
            .Append(IndexName)
            .Append("'");
        }