/src/LinFu.Finders/Interfaces/ICriteria.cs

http://github.com/philiplaureano/LinFu · C# · 29 lines · 10 code · 3 blank · 16 comment · 0 complexity · 3269fbbe94e051fdb5a75fc1c3c518b8 MD5 · raw file

  1. using System;
  2. namespace LinFu.Finders.Interfaces
  3. {
  4. /// <summary>
  5. /// Represents a class that describes the search criteria
  6. /// for a given item <typeparamref name="T">type</typeparamref>.
  7. /// </summary>
  8. /// <typeparam name="T">The target item type.</typeparam>
  9. public interface ICriteria<T>
  10. {
  11. /// <summary>
  12. /// Gets or sets a value indicating the <see cref="CriteriaType" />
  13. /// of the current <see cref="ICriteria{T}" />.
  14. /// </summary>
  15. CriteriaType Type { get; set; }
  16. /// <summary>
  17. /// The condition that will determine whether or not
  18. /// the target item matches the criteria.
  19. /// </summary>
  20. Func<T, bool> Predicate { get; }
  21. /// <summary>
  22. /// Gets or sets a value indicating the weight of the given <see cref="Predicate" />.
  23. /// </summary>
  24. int Weight { get; set; }
  25. }
  26. }