IFilterRule.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System.Collections.Generic;
  2. namespace Vit.Linq.QueryBuilder
  3. {
  4. /// <summary>
  5. /// This interface is used to define a hierarchical filter for a given collection.
  6. /// </summary>
  7. public interface IFilterRule
  8. {
  9. /// <summary>
  10. /// condition - acceptable values are "and" and "or".
  11. /// </summary>
  12. string condition { get; }
  13. /// <summary>
  14. /// could be nested, example: b1.name
  15. /// </summary>
  16. string field { get; }
  17. /// <summary>
  18. /// Supported value :
  19. ///
  20. /// "IsNull", "IsNotNull" ,
  21. /// "=", "!=", "&gt;", "&lt;" , "&gt;=", "&lt;=",
  22. /// "In" , "NotIn" ,
  23. /// "Contains", "NotContains", "StartsWith", "EndsWith" , "IsNullOrEmpty", "IsNotNullOrEmpty"
  24. ///
  25. /// //TODO [array] "is empty", "is not empty"
  26. /// </summary>
  27. string @operator { get; }
  28. /// <summary>
  29. /// nested filter rules
  30. /// </summary>
  31. IEnumerable<IFilterRule> rules { get; }
  32. /// <summary>
  33. /// value of the filter. Supported value types are "integer", "double", "string", "date", "datetime", and "boolean".
  34. /// </summary>
  35. object value { get; }
  36. }
  37. }