共用方式為


SqlExpressionFactory.Constant Method

Definition

Overloads

Constant(Object, RelationalTypeMapping)

Creates a new SqlExpression which represents a constant in a SQL tree.

Constant(Object, Type, RelationalTypeMapping)

Creates a new SqlExpression which represents a constant in a SQL tree.

Constant(Object, RelationalTypeMapping)

Source:
SqlExpressionFactory.cs
Source:
SqlExpressionFactory.cs
Source:
SqlExpressionFactory.cs
Source:
SqlExpressionFactory.cs
Source:
SqlExpressionFactory.cs
Source:
SqlExpressionFactory.cs
Source:
SqlExpressionFactory.cs

Creates a new SqlExpression which represents a constant in a SQL tree.

public virtual Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlConstantExpression Constant (object value, Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping typeMapping = default);
public virtual Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlConstantExpression Constant (object? value, Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping? typeMapping = default);
public virtual Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression Constant (object value, Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping? typeMapping = default);
abstract member Constant : obj * Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping -> Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlConstantExpression
override this.Constant : obj * Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping -> Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlConstantExpression
abstract member Constant : obj * Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping -> Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression
override this.Constant : obj * Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping -> Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression
Public Overridable Function Constant (value As Object, Optional typeMapping As RelationalTypeMapping = Nothing) As SqlConstantExpression
Public Overridable Function Constant (value As Object, Optional typeMapping As RelationalTypeMapping = Nothing) As SqlExpression

Parameters

value
Object

A value.

typeMapping
RelationalTypeMapping

The RelationalTypeMapping associated with the expression.

Returns

An expression representing a constant in a SQL tree.

Implements

Applies to

Constant(Object, Type, RelationalTypeMapping)

Source:
SqlExpressionFactory.cs
Source:
SqlExpressionFactory.cs
Source:
SqlExpressionFactory.cs

Creates a new SqlExpression which represents a constant in a SQL tree.

public virtual Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlConstantExpression Constant (object? value, Type type, Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping? typeMapping = default);
public virtual Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression Constant (object? value, Type type, Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping? typeMapping = default);
abstract member Constant : obj * Type * Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping -> Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlConstantExpression
override this.Constant : obj * Type * Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping -> Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlConstantExpression
abstract member Constant : obj * Type * Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping -> Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression
override this.Constant : obj * Type * Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping -> Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression
Public Overridable Function Constant (value As Object, type As Type, Optional typeMapping As RelationalTypeMapping = Nothing) As SqlConstantExpression
Public Overridable Function Constant (value As Object, type As Type, Optional typeMapping As RelationalTypeMapping = Nothing) As SqlExpression

Parameters

value
Object

A value.

type
Type

The type for the constant. Useful when value is null.

typeMapping
RelationalTypeMapping

The RelationalTypeMapping associated with the expression.

Returns

An expression representing a constant in a SQL tree.

Implements

Applies to