DbExpressionBuilder.Lambda Method

Definition

Creates a DbLambda with the specified inline Lambda function implementation and formal parameters.

Overloads

Lambda(DbExpression, IEnumerable<DbVariableReferenceExpression>)

Creates a DbLambda with the specified inline Lambda function implementation and formal parameters.

Lambda(DbExpression, DbVariableReferenceExpression[])

Creates a DbLambda with the specified inline Lambda function implementation and formal parameters.

Lambda(DbExpression, IEnumerable<DbVariableReferenceExpression>)

Creates a DbLambda with the specified inline Lambda function implementation and formal parameters.

C#
public static System.Data.Common.CommandTrees.DbLambda Lambda(System.Data.Common.CommandTrees.DbExpression body, System.Collections.Generic.IEnumerable<System.Data.Common.CommandTrees.DbVariableReferenceExpression> variables);

Parameters

body
DbExpression

An expression that defines the logic of the Lambda function.

variables
IEnumerable<DbVariableReferenceExpression>

A DbVariableReferenceExpression collection that represents the formal parameters to the Lambda function. These variables are valid for use in the body expression.

Returns

A new DbLambda that describes an inline Lambda function with the specified body and formal parameters.

Exceptions

variables is null or contains null, or body is null.

variables contains more than one element with the same variable name.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

Lambda(DbExpression, DbVariableReferenceExpression[])

Creates a DbLambda with the specified inline Lambda function implementation and formal parameters.

C#
public static System.Data.Common.CommandTrees.DbLambda Lambda(System.Data.Common.CommandTrees.DbExpression body, params System.Data.Common.CommandTrees.DbVariableReferenceExpression[] variables);

Parameters

body
DbExpression

An expression that defines the logic of the Lambda function.

variables
DbVariableReferenceExpression[]

A DbVariableReferenceExpression collection that represents the formal parameters to the Lambda function. These variables are valid for use in the body expression.

Returns

A new DbLambda that describes an inline Lambda function with the specified body and formal parameters.

Exceptions

variables is null or contains null, or body is null.

variables contains more than one element with the same variable name.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1