/// <summary> /// Initializes a new instance of the <see cref="Filter" /> class with one filter element /// of 'Equal to' condition or 'IS NULL' condition (if value is null) /// </summary> /// <param name="column">The column.</param> /// <param name="value">The value.</param> public Filter(string column, object value) { if (value == null) { this.filterElements.Add(FilterElement.Null(column)); } else { this.filterElements.Add(new FilterElement(column, FilterOperator.Eq, value)); } }
/// <summary> /// Gets the filter 'DatumPlatnosti is null or DatumPlatnosti > getdate()' to this filter with "AND" /// </summary> /// <returns></returns> public static Filter NotDeleted() { return(OrElements(FilterElement.Null("DatumPlatnosti"), FilterElement.Custom("DatumPlatnosti > GETDATE()"))); }
/// <summary> /// Appends the '[NOT] NULL' condition to this filter with "AND" /// </summary> /// <param name="filter">The filter.</param> /// <param name="column">The column.</param> /// <param name="not">true for NOT NULL comparison</param> /// <returns></returns> public static Filter AndNull(this Filter filter, string column, bool not) { return(filter.And(not ? FilterElement.NotNull(column) : FilterElement.Null(column))); }