コード例 #1
0
        public static bool TallerThan(this UserModel userModel, int threshold)
        {
            var  specification = new TallerThanSpecification(threshold);
            bool result        = specification.IsSatisfied(userModel);

            return(result);
        }
コード例 #2
0
        public static IQueryable <UserModel> TallerThan(this IQueryable <UserModel> userModels, int threshold)
        {
            var specification = new TallerThanSpecification(threshold);

            return(userModels.Where(specification.Expression));
        }