MemberAccess() public static method

public static MemberAccess ( IQueryable source, Type memberType, string memberName ) : MemberAccessExpressionBuilderBase
source IQueryable
memberType Type
memberName string
return MemberAccessExpressionBuilderBase
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));
        }
        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);
        }