Export (0) Print
Expand All

ObjectQuery<T> Constructor

Initializes a new instance of the ObjectQuery<T> class.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  Name Description
Public method ObjectQuery<T>(String, ObjectContext) Creates a new ObjectQuery<T> instance using the specified Entity SQL command as the initial query.
Public method ObjectQuery<T>(String, ObjectContext, MergeOption) Creates a new ObjectQuery<T> instance using the specified Entity SQL command as the initial query and the specified merge option.
Top

An ObjectQuery<T> can be initialized in such a way that it represents a single scalar result and not a collection of scalar results. Some extension methods require collection results as input. In this case, an ArgumentException is thrown when one of these methods is called. For more information, see Object Queries (Entity Framework).

When your application generates Entity SQL queries at runtime, you should be aware of any command length limitations of the data source. Entity SQL does not enforce limitations on the length of the command text in queries.

Show:
© 2014 Microsoft