Exemplo n.º 1
0
        protected virtual LambdaExpression CreateLambaExpression(Type tSource)
        {
            Debug.Assert(tSource != null);
            Debug.Assert(!string.IsNullOrEmpty(Id.LookupId));

            return(ExpressionFactory.CreateFieldSelectorLambda(tSource, Id.LookupId));
        }
Exemplo n.º 2
0
        protected virtual MethodCallExpression GetPropertyOrFieldAggregateExpression(Type tSource, Expression param)
        {
            // otherwise the target of the aggregate is a property on the source type such as Avg(Age)
            Expression lambda = ExpressionFactory.CreateFieldSelectorLambda(tSource, SourceFieldName);

            return(Expression.Call(EvaluatatorType, Name, new Type[] { tSource }, param, lambda));
        }
Exemplo n.º 3
0
        private static Expression CreateKeySelector <T>(string name, Type keyType, ParameterExpression param)
        {
            // special case for when the key is the data item, not a field of the data item
            if (name.Equals("this", StringComparison.OrdinalIgnoreCase) || name.Equals("that", StringComparison.OrdinalIgnoreCase))
            {
                return(ExpressionFactory.CreateIdentitySelector <T, T>());
            }

            return(ExpressionFactory.CreateFieldSelectorLambda(param, name, keyType));
        }
Exemplo n.º 4
0
        protected override MethodCallExpression GetPropertyOrFieldAggregateExpression(Type tSource, Expression param)
        {
            LambdaExpression lambda = ExpressionFactory.CreateFieldSelectorLambda(tSource, SourceFieldName);

            return(Expression.Call(EvaluatatorType, Name, new Type[] { tSource, tSource.GetFieldType(SourceFieldName) }, param, lambda));
        }