public static bool OlderThan(this UserModel userModel, int threshold) { var specification = new OlderThanSpecification(threshold); bool result = specification.IsSatisfied(userModel); return(result); }
public static IQueryable <UserModel> OlderThan(this IQueryable <UserModel> userModels, int threshold) { var specification = new OlderThanSpecification(threshold); return(userModels.Where(specification.Expression)); }