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