Exemplo n.º 1
0
        protected override LambdaExpression CreateGroupByExpression()
        {
            var memberAccessBuilder = ExpressionBuilderFactory.MemberAccess(this.Queryable, this.groupDescriptor.MemberType, this.groupDescriptor.Member);

            memberAccessBuilder.ParameterExpression = this.ParameterExpression;
            return(memberAccessBuilder.CreateLambdaExpression());
        }
Exemplo n.º 2
0
        private LambdaExpression CreateMemberSelectorExpression()
        {
            var memberAccessBuilder = ExpressionBuilderFactory.MemberAccess(this.ItemType, null, this.Function.SourceField);

            memberAccessBuilder.Options.CopyFrom(this.Options);

            var memberExpression = memberAccessBuilder.CreateMemberAccessExpression();

            memberExpression = ConvertMemberAccessExpression(memberExpression);

            return(Expression.Lambda(memberExpression, memberAccessBuilder.ParameterExpression));
        }
Exemplo n.º 3
0
        protected virtual Expression CreateMemberExpression()
        {
            var memberType = this.FilterDescriptor.MemberType;

            var memberAccessBuilder =
                ExpressionBuilderFactory.MemberAccess(this.ParameterExpression.Type, memberType, this.FilterDescriptor.Member);

            memberAccessBuilder.Options.CopyFrom(this.Options);

            memberAccessBuilder.ParameterExpression = this.ParameterExpression;

            Expression memberAccessExpression = memberAccessBuilder.CreateMemberAccessExpression();

            if (memberType != null && memberAccessExpression.Type.GetNonNullableType() != memberType.GetNonNullableType())
            {
                memberAccessExpression = Expression.Convert(memberAccessExpression, memberType);
            }

            return(memberAccessExpression);
        }