DbExpressionBuilder.Limit Method (DbExpression, DbExpression)

.NET Framework (current version)
 

Creates a new DbLimitExpression that restricts the number of elements in the Argument collection to the specified count Limit value. Tied results are not included in the output.

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

public static DbLimitExpression Limit(
	this DbExpression argument,
	DbExpression count
)

Parameters

argument
Type: System.Data.Common.CommandTrees.DbExpression

An expression that specifies the input collection.

count
Type: System.Data.Common.CommandTrees.DbExpression

An expression that specifies the limit value.

Return Value

Type: System.Data.Common.CommandTrees.DbLimitExpression

A new DbLimitExpression with the specified argument and count limit values that does not include tied results.

Exception Condition
ArgumentNullException

argument or count is null.

ArgumentException

argument does not have a collection result type, or count does not have a result type that is equal or promotable to a 64-bit integer type.

.NET Framework
Available since 4.5
Return to top
Show: