Class SqlFunctionExpression
- Namespace
- Microsoft.EntityFrameworkCore.Query.SqlExpressions
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
An expression that represents a function call in a SQL tree.
This type is typically used by database providers (and other extensions). It is generally not used in application code.
public class SqlFunctionExpression : SqlExpression, IPrintableExpression
- Inheritance
-
SqlFunctionExpression
- Implements
-
IPrintableExpression
- Inherited Members
Constructors
SqlFunctionExpression(SqlExpression, string, bool, bool, Type, RelationalTypeMapping)
Creates a new instance of the SqlFunctionExpression class which represents a niladic function which is invoked on an instance.
public SqlFunctionExpression(SqlExpression instance, string functionName, bool nullable, bool instancePropagatesNullability, Type type, RelationalTypeMapping typeMapping)
Parameters
instance
SqlExpressionAn expression on which the function is defined.
functionName
stringThe name of the function.
nullable
boolA bool value indicating whether this function can return null.
instancePropagatesNullability
boolA value indicating if instance propagates null to result.
type
TypeThe Type of the expression.
typeMapping
RelationalTypeMappingThe RelationalTypeMapping associated with the expression.
SqlFunctionExpression(SqlExpression, string, IEnumerable<SqlExpression>, bool, bool, IEnumerable<bool>, Type, RelationalTypeMapping)
Creates a new instance of the SqlFunctionExpression class which represents a function which is invoked on an instance.
public SqlFunctionExpression(SqlExpression instance, string functionName, IEnumerable<SqlExpression> arguments, bool nullable, bool instancePropagatesNullability, IEnumerable<bool> argumentsPropagateNullability, Type type, RelationalTypeMapping typeMapping)
Parameters
instance
SqlExpressionAn expression on which the function is applied.
functionName
stringThe name of the function.
arguments
IEnumerable<SqlExpression>The arguments of the function.
nullable
boolA bool value indicating whether this function can return null.
instancePropagatesNullability
boolA value indicating if instance propagates null to result.
argumentsPropagateNullability
IEnumerable<bool>A list of bool values indicating whether individual arguments propagate null to result.
type
TypeThe Type of the expression.
typeMapping
RelationalTypeMappingThe RelationalTypeMapping associated with the expression.
SqlFunctionExpression(string, bool, Type, RelationalTypeMapping)
Creates a new instance of the SqlFunctionExpression class which represents a built-in niladic function.
public SqlFunctionExpression(string functionName, bool nullable, Type type, RelationalTypeMapping typeMapping)
Parameters
functionName
stringThe name of the function.
nullable
boolA bool value indicating whether this function can return null.
type
TypeThe Type of the expression.
typeMapping
RelationalTypeMappingThe RelationalTypeMapping associated with the expression.
SqlFunctionExpression(string, IEnumerable<SqlExpression>, bool, IEnumerable<bool>, Type, RelationalTypeMapping)
Creates a new instance of the SqlFunctionExpression class which represents a built-in function.
public SqlFunctionExpression(string functionName, IEnumerable<SqlExpression> arguments, bool nullable, IEnumerable<bool> argumentsPropagateNullability, Type type, RelationalTypeMapping typeMapping)
Parameters
functionName
stringThe name of the function.
arguments
IEnumerable<SqlExpression>The arguments of the function.
nullable
boolA bool value indicating whether this function can return null.
argumentsPropagateNullability
IEnumerable<bool>A list of bool values indicating whether individual arguments propagate null to result.
type
TypeThe Type of the expression.
typeMapping
RelationalTypeMappingThe RelationalTypeMapping associated with the expression.
SqlFunctionExpression(string, string, bool, Type, RelationalTypeMapping)
Creates a new instance of the SqlFunctionExpression class which represents a niladic function.
public SqlFunctionExpression(string schema, string functionName, bool nullable, Type type, RelationalTypeMapping typeMapping)
Parameters
schema
stringThe schema in which the function is defined.
functionName
stringThe name of the function.
nullable
boolA bool value indicating whether this function can return null.
type
TypeThe Type of the expression.
typeMapping
RelationalTypeMappingThe RelationalTypeMapping associated with the expression.
SqlFunctionExpression(string, string, IEnumerable<SqlExpression>, bool, IEnumerable<bool>, Type, RelationalTypeMapping)
Creates a new instance of the SqlFunctionExpression class which represents a function.
public SqlFunctionExpression(string schema, string functionName, IEnumerable<SqlExpression> arguments, bool nullable, IEnumerable<bool> argumentsPropagateNullability, Type type, RelationalTypeMapping typeMapping)
Parameters
schema
stringThe schema in which the function is defined.
functionName
stringThe name of the function.
arguments
IEnumerable<SqlExpression>The arguments of the function.
nullable
boolA bool value indicating whether this function can return null.
argumentsPropagateNullability
IEnumerable<bool>A list of bool values indicating whether individual arguments propagate null to result.
type
TypeThe Type of the expression.
typeMapping
RelationalTypeMappingThe RelationalTypeMapping associated with the expression.
Properties
Arguments
The list of arguments of this function.
public virtual IReadOnlyList<SqlExpression> Arguments { get; }
Property Value
ArgumentsPropagateNullability
A list of bool values indicating whether individual argument propagate null to the result.
public virtual IReadOnlyList<bool> ArgumentsPropagateNullability { get; }
Property Value
Instance
The instance on which this function is applied.
public virtual SqlExpression Instance { get; }
Property Value
InstancePropagatesNullability
A bool value indicating if the instance propagates null to the result.
public virtual bool? InstancePropagatesNullability { get; }
Property Value
- bool?
IsBuiltIn
A bool value indicating if the function is built-in.
public virtual bool IsBuiltIn { get; }
Property Value
IsNiladic
A bool value indicating if the function is niladic.
public virtual bool IsNiladic { get; }
Property Value
IsNullable
A bool value indicating if the function can return null result.
public virtual bool IsNullable { get; }
Property Value
Name
The name of the function.
public virtual string Name { get; }
Property Value
Schema
The schema in which the function is defined, if any.
public virtual string Schema { get; }
Property Value
Methods
ApplyTypeMapping(RelationalTypeMapping)
Applies supplied type mapping to this expression.
public virtual SqlFunctionExpression ApplyTypeMapping(RelationalTypeMapping typeMapping)
Parameters
typeMapping
RelationalTypeMappingA relational type mapping to apply.
Returns
- SqlFunctionExpression
A new expression which has supplied type mapping.
Equals(object)
public override bool Equals(object obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
Print(ExpressionPrinter)
protected override void Print(ExpressionPrinter expressionPrinter)
Parameters
expressionPrinter
ExpressionPrinter
Update(SqlExpression, IReadOnlyList<SqlExpression>)
Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression.
public virtual SqlFunctionExpression Update(SqlExpression instance, IReadOnlyList<SqlExpression> arguments)
Parameters
instance
SqlExpressionThe Instance property of the result.
arguments
IReadOnlyList<SqlExpression>The Arguments property of the result.
Returns
- SqlFunctionExpression
This expression if no children changed, or an expression with the updated children.
VisitChildren(ExpressionVisitor)
protected override Expression VisitChildren(ExpressionVisitor visitor)
Parameters
visitor
ExpressionVisitor