SqlParser.cs
/// <summary>
/// Stringify comming column Expressions into sql where clause string 
/// </summary>
/// <param name="sqlColumnsNamesMapFilter"></param>
/// <returns></returns>
Stringify comming column Expressions into sql where clause string
Stringify comming column Expressions into sql where clause string
public string StringifyColumnFilterExpressionsToSqlQuery(Dictionary<string, string> sqlColumnsNamesMapFilter)
		{
			this.sqlColumnsMap = sqlColumnsNamesMapFilter;
			var fullColumnFilterExpressionsString = string.Empty; 
			var columnFilterExpressionStringList = new List<string>(); 
			if (this.columnExpressions == null)
			{
				return string.Empty;
			}
			foreach (var expression in this.columnExpressions)
			{
				var expressionText = string.Empty; 
				var colName = this.GetSQLColumnName(expression.ColumnName);
				if (!string.IsNullOrWhiteSpace(colName)
					&& expression.ColumnFilterExpressions != null
					&& ( !string.IsNullOrWhiteSpace(expression.ColumnFilterExpressions?.FirstValue)
					    || expression.ColumnFilterExpressions.ElementSet != null )
					&& !string.IsNullOrWhiteSpace(expression.ColumnFilterExpressions?.Operand))
				{
					switch (expression.ColumnDataType)
					{
						case ColumnDataType.Text:
							expressionText = this.GetStringifiedExpression(expression, colName);
							break;
						case ColumnDataType.Date:
							expressionText = this.GetStringifiedExpression(expression, colName);
							break;
						case ColumnDataType.Numeric:
							expressionText = this.GetStringifiedExpression(expression, colName);
							break;
						case ColumnDataType.Boolean:
							expressionText = this.GetStringifiedExpression(expression, colName);
							break;
						default:
							expressionText = string.Empty;
							break;
					}
				}
				if (!string.IsNullOrWhiteSpace(expressionText))
				{
					columnFilterExpressionStringList.Add(string.Format(" {0} ", expressionText));
				}
			}
			fullColumnFilterExpressionsString = string.Join(" AND ", columnFilterExpressionStringList);
			return $" {fullColumnFilterExpressionsString} ";
		}
public string StringifyColumnFilterExpressionsToSqlQuery ( Dictionary < string , string > sqlColumnsNamesMapFilter ) { this . sqlColumnsMap = sqlColumnsNamesMapFilter ; var fullColumnFilterExpressionsString = string . Empty ; var columnFilterExpressionStringList = new List < string > ( ) ; if ( this . columnExpressions == null ) { return string . Empty ; } foreach ( var expression in this . columnExpressions ) { var expressionText = string . Empty ; var colName = this . GetSQLColumnName ( expression . ColumnName ) ; if ( ! string . IsNullOrWhiteSpace ( colName ) && expression . ColumnFilterExpressions != null && ( ! string . IsNullOrWhiteSpace ( expression . ColumnFilterExpressions ? . FirstValue ) || expression . ColumnFilterExpressions . ElementSet != null ) && ! string . IsNullOrWhiteSpace ( expression . ColumnFilterExpressions ? . Operand ) ) { switch ( expression . ColumnDataType ) { case ColumnDataType . Text : expressionText = this . GetStringifiedExpression ( expression , colName ) ; break ; case ColumnDataType . Date : expressionText = this . GetStringifiedExpression ( expression , colName ) ; break ; case ColumnDataType . Numeric : expressionText = this . GetStringifiedExpression ( expression , colName ) ; break ; case ColumnDataType . Boolean : expressionText = this . GetStringifiedExpression ( expression , colName ) ; break ; default : expressionText = string . Empty ; break ; } } if ( ! string . IsNullOrWhiteSpace ( expressionText ) ) { columnFilterExpressionStringList . Add ( string . Format ( " " , expressionText ) ) ; } } fullColumnFilterExpressionsString = string . Join ( " " , columnFilterExpressionStringList ) ; return $" { fullColumnFilterExpressionsString } " ; }
Stringify comming column Expressions into sql where clause string
Stringify comming column Expressions into sql where clause string
// expression text value  // column name  // generate stringified expression // join to generate the full sql where clause string
None
sqlColumnsNamesMapFilter
Dictionary<string, string>
None