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