AnySpecification.cs 697 B

12345678910111213141516171819202122
  1. using System;
  2. using System.Linq.Expressions;
  3. namespace Abp.Specifications
  4. {
  5. /// <summary>
  6. /// Represents the specification that can be satisfied by the given object
  7. /// in any circumstance.
  8. /// </summary>
  9. /// <typeparam name="T">The type of the object to which the specification is applied.</typeparam>
  10. public sealed class AnySpecification<T> : Specification<T>
  11. {
  12. /// <summary>
  13. /// Gets the LINQ expression which represents the current specification.
  14. /// </summary>
  15. /// <returns>The LINQ expression.</returns>
  16. public override Expression<Func<T, bool>> ToExpression()
  17. {
  18. return o => true;
  19. }
  20. }
  21. }