public static FilterPredicate Translate(Expression <Func <bool> > expression)
 {
     if (expression == null)
     {
         throw new ArgumentNullException(nameof(expression));
     }
     try
     {
         return(TranslateFilterPredicate(FilterNormalizer.Normalize(expression.Body)));
     }
     catch (TpmException exception)
     {
         throw new NotSupportedException($"Cannot translate FilterPredicate \"{expression}\" because {exception.Message}", exception);
     }
 }
Пример #2
0
 public static FilterPredicate Translate(Expression <Func <bool> > expression)
 {
     try
     {
         return(TranslateFilterPredicate(FilterNormalizer.Normalize(expression.Body)));
     }
     catch (TpmException exception)
     {
         throw new NotSupportedException(
                   string.Format(
                       "Cannot translate FilterPredicate \"{0}\" because {1}",
                       expression,
                       exception.Message),
                   exception);
     }
 }
Пример #3
0
        public static Expression Normalize(Expression expression)
        {
            var normalizer = new FilterNormalizer();

            return(normalizer.Visit(expression));
        }