C# Class Microsoft.WindowsAzure.MobileServices.FilterBuildingExpressionVisitor

Create an OData filter expression by walking an expression tree.
Exibir arquivo Open project: xamarin/azure-mobile-services Class Usage Examples

Public Methods

Method Description
Create ( Expression expression ) : string

Translate an expression tree into a compiled OData query.

Visit ( Expression node ) : Expression

Visit a node of the expression.

Protected Methods

Method Description
GetTableMember ( Expression expression ) : Microsoft.WindowsAzure.MobileServices.SerializableMember

Get the table member referenced by an expression or return null.

VisitBinary ( BinaryExpression expression ) : Expression

Process binary comparison operators.

VisitConstant ( ConstantExpression expression ) : Expression

Process constant values.

VisitMember ( MemberExpression expression ) : Expression

Process member references.

VisitMethodCall ( MethodCallExpression expression ) : Expression

Process method calls and translate them into OData.

VisitUnary ( UnaryExpression expression ) : Expression

Process the not operator.

Private Methods

Method Description
FilterBuildingExpressionVisitor ( ) : System
GetFilterMethodArguments ( MethodCallExpression expression, string methodName, bool isStatic ) : IEnumerable

Returns the ordered collection of arguments for the the given OData filter method given the MethodCallExpression instance.

IsConversionImplicit ( UnaryExpression expression, Type from, Type to ) : bool

Check whether a conversion from one type to another will be made implicitly by the server. This is only considered valid for member references.

This relies on the fact that all numeric types on the server are represented as doubles.

MarkVisited ( ) : void

Mark an expression as visited. This method is called when we're finished processing any expression we're accepting as a valid Mobile Services filter. Note that it must be called immediately before returning the expression (because any nested Visit calls will stomp its tracking mechanism).

StripUnaryOperator ( Expression expression ) : Expression

Remove the operator from certain unary expressions like quote or conversions we can ignore.

Method Details

Create() public static method

Translate an expression tree into a compiled OData query.
public static Create ( Expression expression ) : string
expression System.Linq.Expressions.Expression The expression tree.
return string

GetTableMember() protected static method

Get the table member referenced by an expression or return null.
protected static GetTableMember ( Expression expression ) : Microsoft.WindowsAzure.MobileServices.SerializableMember
expression System.Linq.Expressions.Expression The expression to check.
return Microsoft.WindowsAzure.MobileServices.SerializableMember

Visit() public method

Visit a node of the expression.
public Visit ( Expression node ) : Expression
node System.Linq.Expressions.Expression The node to visit.
return System.Linq.Expressions.Expression

VisitBinary() protected method

Process binary comparison operators.
protected VisitBinary ( BinaryExpression expression ) : Expression
expression System.Linq.Expressions.BinaryExpression The expression to visit.
return System.Linq.Expressions.Expression

VisitConstant() protected method

Process constant values.
protected VisitConstant ( ConstantExpression expression ) : Expression
expression System.Linq.Expressions.ConstantExpression The expression to visit.
return System.Linq.Expressions.Expression

VisitMember() protected method

Process member references.
protected VisitMember ( MemberExpression expression ) : Expression
expression System.Linq.Expressions.MemberExpression The expression to visit.
return System.Linq.Expressions.Expression

VisitMethodCall() protected method

Process method calls and translate them into OData.
protected VisitMethodCall ( MethodCallExpression expression ) : Expression
expression System.Linq.Expressions.MethodCallExpression The expression to visit.
return System.Linq.Expressions.Expression

VisitUnary() protected method

Process the not operator.
protected VisitUnary ( UnaryExpression expression ) : Expression
expression System.Linq.Expressions.UnaryExpression The expression to visit.
return System.Linq.Expressions.Expression