예제 #1
0
        private bool ValidByCriteria(string criteria, object obj)
        {
            var descriptor       = ObjectSpace.GetEvaluatorContextDescriptor(obj.GetType());
            var criteriaOperator = ObjectSpace.ParseCriteria(criteria);
            var wrapper          = new LocalizedCriteriaWrapper(obj.GetType(), criteriaOperator);

            wrapper.UpdateParametersValues(obj);
            return(ObjectSpace.GetExpressionEvaluator(descriptor, wrapper.CriteriaOperator).Fit(obj));
        }