예제 #1
0
        public string GetQuery()
        {
            string result = "";

            if (JoinOperator == null)
            {
                result = $"{LeftElement.GetQuery()} {ComparisonOperator} {RightElement.GetQuery()}";
            }
            else
            {
                result = string.Join($" {JoinOperator} ", Statements.Select(x => $"{x.GetQuery()}"));
            }
            return(result);
        }
예제 #2
0
 public override void Validate()
 {
     base.Validate();
     if (LeftElement.GetType() != typeof(ClauseVariable))
     {
         throw new QueryException(String.Format("Expected Left Element to be of type [{0}]", typeof(ClauseVariable).FullName));
     }
     if (RightElement.GetType() != typeof(ClauseListElement))
     {
         throw new QueryException(String.Format("Expected Right Element to be of type [{0}]", typeof(ClauseListElement).FullName));
     }
     if (Operator == EListOperator.None)
     {
         throw new QueryException("Clause operator not set.");
     }
 }