ObjectContext::Translate<TElement> Method (DbDataReader^)
Translates a DbDataReader that contains rows of entity data to objects of the requested entity type.
Assembly: System.Data.Entity (in System.Data.Entity.dll)
public: generic<typename TElement> ObjectResult<TElement>^ Translate( DbDataReader^ reader )
Parameters
- reader
-
Type:
System.Data.Common::DbDataReader^
The DbDataReader that contains entity data to translate into entity objects.
Return Value
Type: System.Data.Objects::ObjectResult<TElement>^An enumeration of objects of type TResult.
Type Parameters
- TResult
The entity type of the data in the DbDataReader.
| Exception | Condition |
|---|---|
| ArgumentNullException | When reader is null. |
The Translate<TElement> method is used to translate entity data from a DbDataReader into objects of the requested type. This process is performed automatically when an ObjectQuery<T> is executed to return entity data. The Translate<TElement> method enables you to execute a standard ADO.NET query against a data source and translate the returned data rows into entity objects.
The supplied DbDataReader must contain data that maps to the requested entity type.
For more information, see:
Available since 4.0