Export (0) Print
Expand All

ObjectContext.Translate<TElement> Method (DbDataReader)

Translates a DbDataReader that contains rows of entity data to objects of the requested entity type.

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

public ObjectResult<TElement> Translate<TElement>(
	DbDataReader reader
)

Type Parameters

TElement

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.

ExceptionCondition
ArgumentNullException

When reader is null.

The Translate 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 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:

Executing Store Commands and

How to: Directly Execute Arbitrary Command Against the Store

.NET Framework

Supported in: 4

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft