/// <summary>
 /// Returns the number of all elements.
 /// </summary>
 /// <typeparam name="T">The entity type.</typeparam>
 /// <param name="queryable">The queryable.</param>
 /// <returns></returns>
 public static int Count <T>(this ISpecificationQueryable <T> queryable)
 {
     return(queryable.Count(Identity <T>()));
 }
 /// <summary>
 /// Returns a list of elements filtered by a given predicate.
 /// </summary>
 /// <typeparam name="T">The entity type.</typeparam>
 /// <param name="queryable">The queryable.</param>
 /// <param name="predicate">The predicate to filter the elements.</param>
 /// <returns></returns>
 public static List <T> ToList <T>(this ISpecificationQueryable <T> queryable,
                                   Expression <Func <T, bool> > predicate)
 {
     return(queryable.ToList(Relay <T, T>(q => q.Where(predicate))));
 }
 /// <summary>
 /// Returns the first element satisfying a given predicate.
 /// </summary>
 /// <typeparam name="T">The entity type.</typeparam>
 /// <param name="queryable">The queryable.</param>
 /// <param name="predicate">The predicate to filter the elements.</param>
 /// <returns></returns>
 public static T FirstOrDefault <T>(this ISpecificationQueryable <T> queryable,
                                    Expression <Func <T, bool> > predicate)
 {
     return(queryable.FirstOrDefault(Relay <T, T>(q => q.Where(predicate))));
 }
 /// <summary>
 /// Returns a list of elements with an identity specification.
 /// </summary>
 /// <typeparam name="T">The entity type.</typeparam>
 /// <param name="queryable">The queryable.</param>
 /// <returns></returns>
 public static List <T> ToList <T>(this ISpecificationQueryable <T> queryable)
 {
     return(queryable.ToList(Identity <T>()));
 }
 /// <summary>
 /// Returns the first element.
 /// </summary>
 /// <typeparam name="T">The entity type.</typeparam>
 /// <param name="queryable">The queryable.</param>
 /// <returns></returns>
 public static T FirstOrDefault <T>(this ISpecificationQueryable <T> queryable)
 {
     return(queryable.FirstOrDefault(Identity <T>()));
 }