ObjectQuery<T> Constructor (String^, ObjectContext^)
.NET Framework (current version)
Creates a new ObjectQuery<T> instance using the specified Entity SQL command as the initial query.
Assembly: System.Data.Entity (in System.Data.Entity.dll)
Parameters
- commandText
-
Type:
System::String^
The Entity SQL query.
- context
-
Type:
System.Data.Objects::ObjectContext^
The ObjectContext on which to execute the query.
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.
The example in this topic is based on the AdventureWorks Sales Model. The example shows how to construct an instance of the ObjectQuery<T> class.
.NET Framework
Available since 3.5
Available since 3.5
Show: