// TODO: all operators
//            public CompareOperatorPart NotEqual() => BuildCompareOperatorPart(CompareOperatorKeyword.NotEqual);
//            public CompareOperatorPart GreaterThan() => BuildCompareOperatorPart(CompareOperatorKeyword.GreaterThan);
//            public CompareOperatorPart LessThan() => BuildCompareOperatorPart(CompareOperatorKeyword.LessThan);
//            public CompareOperatorPart GreaterThanOrEqual() => BuildCompareOperatorPart(CompareOperatorKeyword.GreaterThanOrEqual);
//            public CompareOperatorPart LessThanOrEqual() => BuildCompareOperatorPart(CompareOperatorKeyword.LessThanOrEqual);
//            public CompareOperatorPart StartsWith() => BuildCompareOperatorPart(CompareOperatorKeyword.StartsWith);
//            public CompareOperatorPart EndsWith() => BuildCompareOperatorPart(CompareOperatorKeyword.EndsWith);
//            public CompareOperatorPart Contains() => BuildCompareOperatorPart(CompareOperatorKeyword.Contains);

            private StatementPart Build(StatementKeyword statementKeyword)
            {
                var part = new StatementPart(statementKeyword, TestQueryBuilder);

                TestQueryBuilder._queryParts.Add(part);
                return(part);
            }
Example #2
0
        /// <summary>
        /// Checks if given statement is allowed for this column type.
        /// </summary>
        /// <returns>True if allowed; false otherwise.</returns>
        internal bool IsAllowed(StatementKeyword statementKeyword)
        {
            switch (statementKeyword.StatementType)
            {
            case StatementType.IsEmpty:
            case StatementType.IsNotEmpty:
                return(SystemType.IsNullable());

            case StatementType.IsFalse:
            case StatementType.IsTrue:
                return(SystemType == typeof(bool) || SystemType == typeof(bool?));
            }

            return(false);
        }
 public StatementPart(StatementKeyword statementKeyword, TestQueryBuilder testQueryBuilder) : base(
         testQueryBuilder)
 {
     StatementKeyword = statementKeyword;
 }