Export (0) Print
Expand All
Expand Minimize

DbExpressionBuilder.BindAs Method

.NET Framework 4.6 and 4.5

Creates a new DbExpressionBinding that uses the specified variable name to bind the given expression

Namespace:  System.Data.Common.CommandTrees.ExpressionBuilder
Assembly:  System.Data.Entity (in System.Data.Entity.dll)

public static DbExpressionBinding BindAs(
	this DbExpression input,
	string varName


Type: System.Data.Common.CommandTrees.DbExpression

The expression to bind.

Type: System.String

The variable name that should be used for the binding.

Return Value

Type: System.Data.Common.CommandTrees.DbExpressionBinding
A new expression binding with the specified expression and variable name.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DbExpression. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).


input or varName is null.


input does not have a collection result.

.NET Framework

Supported in: 4.6, 4.5
© 2015 Microsoft