DbExpressionBuilder.Limit Method (DbExpression, DbExpression)

 

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.Entity.Core.Common.CommandTrees.ExpressionBuilder
Assembly:  EntityFramework (in EntityFramework.dll)

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

Parameters

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

An expression that specifies the input collection.

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

An expression that specifies the limit value.

Return Value

Type: System.Data.Entity.Core.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.