QuerySqlGenerator.TryGetOperatorInfo(SqlExpression, Int32, Boolean) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a numeric value representing the precedence of the given expression
, as well as its associativity.
These control whether parentheses are generated around the expression.
protected virtual bool TryGetOperatorInfo (Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression expression, out int precedence, out bool isAssociative);
abstract member TryGetOperatorInfo : Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression * int * bool -> bool
override this.TryGetOperatorInfo : Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression * int * bool -> bool
Protected Overridable Function TryGetOperatorInfo (expression As SqlExpression, ByRef precedence As Integer, ByRef isAssociative As Boolean) As Boolean
Parameters
- expression
- SqlExpression
The expression for which to get the precedence and associativity.
- precedence
- Int32
If the method returned true
, contains the precedence of the provided expression
.
Otherwise, contains default values.
- isAssociative
- Boolean
If the method returned true
, contains the associativity of the provided expression
.
Otherwise, contains default values.
Returns
true
if the expression operator info is known and was returned in precedence
and
isAssociative
. Otherwise, false
.
Remarks
The default implementation always returns false, so that parentheses almost always get added. Providers can override this method to remove parentheses where they aren't necessary.
Applies to
Entity Framework