コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WhereClause" /> class.
 /// </summary>
 /// <param name="builder">The builder.</param>
 /// <param name="column">The field.</param>
 /// <param name="compareOperator">The compare operator.</param>
 /// <param name="compareValue">The compare value.</param>
 public WhereClause(ISelectStringBuilder builder, string column, ComparisonOperator compareOperator, object compareValue)
 {
     this.builder = builder;
     ColumnName   = column;
     Operator     = compareOperator;
     Value        = compareValue;
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JoinClause" /> struct.
 /// </summary>
 /// <param name="builder">The builder.</param>
 /// <param name="joinType">Type of the join.</param>
 /// <param name="toTableName">Name of to table.</param>
 /// <param name="toColumnName">Name of to column.</param>
 /// <param name="operator">The operator.</param>
 /// <param name="fromTableName">Name of from table.</param>
 /// <param name="fromColumnName">Name of from column.</param>
 public JoinClause(ISelectStringBuilder builder, JoinType joinType, string toTableName, string toColumnName,
                   ComparisonOperator @operator,
                   string fromTableName, string fromColumnName) : this(builder, joinType, toTableName)
 {
     FromTable          = fromTableName;
     FromColumn         = fromColumnName;
     ComparisonOperator = @operator;
     ToColumn           = toColumnName;
 }
コード例 #3
0
        private static string BuildSelectString(MessageQuery messageQuery, ISelectStringBuilder ssb)
        {
            ssb.SelectAll().From(TableName);

            if (messageQuery.Id != null)
            {
                ssb.Where("content_id").EqualsTo(messageQuery.Id);
            }
            if (messageQuery.CreatedStartDate != null)
            {
                ssb.Where("created_at").GreaterOrEqualsTo(messageQuery.CreatedStartDate);
            }
            if (messageQuery.CreatedEndDate != null)
            {
                ssb.Where("created_at").LessOrEqualsTo(messageQuery.CreatedEndDate);
            }
            if (messageQuery.ContentType != null)
            {
                ssb.Where("content_type").EqualsTo(messageQuery.ContentType);
            }
            if (messageQuery.ErrorType != null)
            {
                ssb.Where("error_type").EqualsTo(messageQuery.ErrorType);
            }
            if (messageQuery.Status != null)
            {
                ssb.Where("status").EqualsTo(messageQuery.Status);
            }
            if (messageQuery.Type != null)
            {
                ssb.Where("type").EqualsTo(messageQuery.Type);
            }
            if (messageQuery.ExecutionDurationAbove != null)
            {
                ssb.Where("execution_duration").GreaterOrEqualsTo(messageQuery.ExecutionDurationAbove);
            }
            if (messageQuery.ExecutionDurationBelow != null)
            {
                ssb.Where("execution_duration").LessOrEqualsTo(messageQuery.ExecutionDurationBelow);
            }
            if (messageQuery.Skip > 0)
            {
                ssb.Skip(messageQuery.Skip);
            }
            if (messageQuery.Take > 0)
            {
                ssb.Take(messageQuery.Take);
            }

            return(ssb.Build());
        }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JoinClause"/> class.
 /// </summary>
 /// <param name="builder">The builder.</param>
 /// <param name="joinType">Type of the join.</param>
 /// <param name="toTableName">Name of to table.</param>
 public JoinClause(ISelectStringBuilder builder, JoinType joinType, string toTableName)
 {
     this.builder = builder;
     JoinType     = joinType;
     ToTable      = toTableName;
 }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WhereClause" /> struct.
 /// </summary>
 /// <param name="builder">The builder.</param>
 /// <param name="column">The column.</param>
 public WhereClause(ISelectStringBuilder builder, string column) : this(builder, column, ComparisonOperator.NotSet, null)
 {
 }