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

            memberAccessBuilder.ParameterExpression = this.ParameterExpression;
            return(memberAccessBuilder.CreateLambdaExpression());
        }
        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));
        }
        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);
        }