ObjectQuery<T> Constructor

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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

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

NameDescription
System_CAPS_pubmethodObjectQuery<T>(String, ObjectContext)

Creates a new ObjectQuery<T> instance using the specified Entity SQL command as the initial query.

System_CAPS_pubmethodObjectQuery<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.

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.

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.

Return to top
Show: