Table of Contents

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 SqlExpression

An expression on which the function is defined.

functionName string

The name of the function.

nullable bool

A bool value indicating whether this function can return null.

instancePropagatesNullability bool

A value indicating if instance propagates null to result.

type Type

The Type of the expression.

typeMapping RelationalTypeMapping

The 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 SqlExpression

An expression on which the function is applied.

functionName string

The name of the function.

arguments IEnumerable<SqlExpression>

The arguments of the function.

nullable bool

A bool value indicating whether this function can return null.

instancePropagatesNullability bool

A 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 Type

The Type of the expression.

typeMapping RelationalTypeMapping

The 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 string

The name of the function.

nullable bool

A bool value indicating whether this function can return null.

type Type

The Type of the expression.

typeMapping RelationalTypeMapping

The 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 string

The name of the function.

arguments IEnumerable<SqlExpression>

The arguments of the function.

nullable bool

A 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 Type

The Type of the expression.

typeMapping RelationalTypeMapping

The 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 string

The schema in which the function is defined.

functionName string

The name of the function.

nullable bool

A bool value indicating whether this function can return null.

type Type

The Type of the expression.

typeMapping RelationalTypeMapping

The 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 string

The schema in which the function is defined.

functionName string

The name of the function.

arguments IEnumerable<SqlExpression>

The arguments of the function.

nullable bool

A 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 Type

The Type of the expression.

typeMapping RelationalTypeMapping

The RelationalTypeMapping associated with the expression.

Properties

Arguments

The list of arguments of this function.

public virtual IReadOnlyList<SqlExpression> Arguments { get; }

Property Value

IReadOnlyList<SqlExpression>

ArgumentsPropagateNullability

A list of bool values indicating whether individual argument propagate null to the result.

public virtual IReadOnlyList<bool> ArgumentsPropagateNullability { get; }

Property Value

IReadOnlyList<bool>

Instance

The instance on which this function is applied.

public virtual SqlExpression Instance { get; }

Property Value

SqlExpression

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

bool

IsNiladic

A bool value indicating if the function is niladic.

public virtual bool IsNiladic { get; }

Property Value

bool

IsNullable

A bool value indicating if the function can return null result.

public virtual bool IsNullable { get; }

Property Value

bool

Name

The name of the function.

public virtual string Name { get; }

Property Value

string

Schema

The schema in which the function is defined, if any.

public virtual string Schema { get; }

Property Value

string

Methods

ApplyTypeMapping(RelationalTypeMapping)

Applies supplied type mapping to this expression.

public virtual SqlFunctionExpression ApplyTypeMapping(RelationalTypeMapping typeMapping)

Parameters

typeMapping RelationalTypeMapping

A 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

bool

GetHashCode()

public override int GetHashCode()

Returns

int

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 SqlExpression

The 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

Returns

Expression