protected virtual string CreateWhereFieldStringForValue(string field, OP whereOperator, params string[] value)
        {
            if (whereOperator == OP.NULL_OR_DI)
            {
                return(string.Format(
                           "({0} IS NULL OR {0} {1} {2})",
                           field,
                           SqlBuilderHelper.GetStringForOperator(whereOperator),
                           value));
            }
            if (whereOperator == OP.NOT_IN && value.Length == 0)
            {
                return("/* NOT IN () */ 1 = 1");
            }

            if (whereOperator == OP.IN && value.Length == 0)
            {
                return("/* IN () */ 1 = 0");
            }

            return
                ($"{field} {SqlBuilderHelper.GetStringForOperator(whereOperator)} {(value != null ? GetStringValueByOperator(whereOperator, value) : GetNullStringValueByOperator(whereOperator))}");
        }
Exemple #2
0
 protected override string CreateWhereFieldStringForParameter(string field, string paramName, OP whereOperator)
 {
     return($"{GetAliasForType()}.{field} {SqlBuilderHelper.GetStringForOperator(whereOperator)} {DbConfigConfig.WithParameters(paramName)}");
 }
 protected virtual string CreateWhereFieldStringForParameter(string field, string paramName, OP whereOperator)
 {
     return($"{field} {SqlBuilderHelper.GetStringForOperator(whereOperator)} {DbConfig.WithParameters(paramName)}");
 }