Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ObjectContext::Translate Method

Entity Framework 6.0
 

Translates the data from a DbDataReader into sequence of entities.

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

NameDescription
System_CAPS_pubmethodTranslate<TElement>(DbDataReader^)

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

System_CAPS_pubmethodTranslate<TEntity>(DbDataReader^, String^, MergeOption)

Translates a DbDataReader that contains rows of entity data to objects of the requested entity type, in a specific entity set, and with the specified merge option.

Return to top

ObjectContext::Translate<TElement> Method (DbDataReader^)

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

public:
generic<typename TElement>
virtual 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.Entity.Core.Objects::ObjectResult<TElement>^

An enumeration of objects of type TResult .

Type Parameters

TElement

The entity type.

Exception Condition
ArgumentNullException

When reader is null.

Return to top

ObjectContext::Translate<TEntity> Method (DbDataReader^, String^, MergeOption)

Translates a DbDataReader that contains rows of entity data to objects of the requested entity type, in a specific entity set, and with the specified merge option.

public:
generic<typename TEntity>
[SuppressMessageAttribute("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", 
	Justification = "Generic parameters are required for strong-typing of the return type.")]
virtual ObjectResult<TEntity>^ Translate(
	DbDataReader^ reader,
	String^ entitySetName,
	MergeOption mergeOption
)

Parameters

reader
Type: System.Data.Common::DbDataReader^

The DbDataReader that contains entity data to translate into entity objects.

entitySetName
Type: System::String^

The entity set of the TResult type.

mergeOption
Type: System.Data.Entity.Core.Objects::MergeOption

The MergeOption to use when translated objects are added to the object context. The default is AppendOnly .

Return Value

Type: System.Data.Entity.Core.Objects::ObjectResult<TEntity>^

An enumeration of objects of type TResult .

Type Parameters

TEntity

The entity type.

Exception Condition
ArgumentNullException

When reader is null.

ArgumentOutOfRangeException

When the supplied mergeOption is not a valid MergeOption value.

InvalidOperationException

When the supplied entitySetName is not a valid entity set for the TResult type.

Return to top
Show: