ObjectQuery<T>.Top Method (String, ObjectParameter[])

 

Limits the query results to a specified number of items.

Namespace:   System.Data.Entity.Core.Objects
Assembly:  EntityFramework (in EntityFramework.dll)

public ObjectQuery<T> Top(
	string count,
	params ObjectParameter[] parameters
)

Parameters

count
Type: System.String

The number of items in the results as a string.

parameters
Type: System.Data.Entity.Core.Objects.ObjectParameter[]

An optional set of query parameters that should be in scope when parsing.

Return Value

Type: System.Data.Entity.Core.Objects.ObjectQuery<T>

A new ObjectQuery<T> instance that is equivalent to the original instance with TOP applied.

Exception Condition
ArgumentNullException

count is null.

ArgumentException

count is an empty string.