ObjectContext.Translate 메서드
정의
오버로드
Translate<TElement>(DbDataReader) |
엔터티 데이터의 행이 포함된 DbDataReader를 요청된 엔터티 형식의 개체로 변환합니다.Translates a DbDataReader that contains rows of entity data to objects of the requested entity type. |
Translate<TEntity>(DbDataReader, String, MergeOption) |
엔터티 데이터의 행이 포함된 DbDataReader를 특정 엔터티 집합에서 지정된 병합 옵션을 사용하여 요청된 엔터티 형식의 개체로 변환합니다.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. |
Translate<TElement>(DbDataReader)
엔터티 데이터의 행이 포함된 DbDataReader를 요청된 엔터티 형식의 개체로 변환합니다.Translates a DbDataReader that contains rows of entity data to objects of the requested entity type.
public:
generic <typename TElement>
System::Data::Objects::ObjectResult<TElement> ^ Translate(System::Data::Common::DbDataReader ^ reader);
public System.Data.Objects.ObjectResult<TElement> Translate<TElement> (System.Data.Common.DbDataReader reader);
member this.Translate : System.Data.Common.DbDataReader -> System.Data.Objects.ObjectResult<'Element>
Public Function Translate(Of TElement) (reader As DbDataReader) As ObjectResult(Of TElement)
형식 매개 변수
- TElement
DbDataReader에서 데이터의 엔터티 형식입니다.The entity type of the data in the DbDataReader.
매개 변수
- reader
- DbDataReader
엔터티 개체로 변환할 엔터티 데이터를 포함하는 DbDataReader입니다.The DbDataReader that contains entity data to translate into entity objects.
반환
- ObjectResult<TElement>
TResult
형식의 개체 열거형입니다.An enumeration of objects of type TResult
.
예외
reader
가 null
일 경우When reader
is null
.
설명
메서드는의 Translate 엔터티 데이터를 요청 된 형식의 개체로 변환 하는 데 사용 됩니다 DbDataReader .The Translate method is used to translate entity data from a DbDataReader into objects of the requested type. 이 프로세스는를 ObjectQuery<T> 실행 하 여 엔터티 데이터를 반환 하는 경우 자동으로 수행 됩니다.This process is performed automatically when an ObjectQuery<T> is executed to return entity data. Translate메서드를 사용 하면 데이터 원본에 대해 표준 ADO.NET 쿼리를 실행 하 고 반환 된 데이터 행을 엔터티 개체로 변환할 수 있습니다.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.
제공 된은 DbDataReader 요청 된 엔터티 형식에 매핑되는 데이터를 포함 해야 합니다.The supplied DbDataReader must contain data that maps to the requested entity type.
자세한 내용은 다음을 참조하세요.For more information, see:
저장소 명령 직접 실행Directly Executing Store Commands and
방법: 데이터 원본에 대해 명령 직접 실행How to: Directly Execute Commands Against the Data Source
적용 대상
Translate<TEntity>(DbDataReader, String, MergeOption)
엔터티 데이터의 행이 포함된 DbDataReader를 특정 엔터티 집합에서 지정된 병합 옵션을 사용하여 요청된 엔터티 형식의 개체로 변환합니다.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>
System::Data::Objects::ObjectResult<TEntity> ^ Translate(System::Data::Common::DbDataReader ^ reader, System::String ^ entitySetName, System::Data::Objects::MergeOption mergeOption);
public System.Data.Objects.ObjectResult<TEntity> Translate<TEntity> (System.Data.Common.DbDataReader reader, string entitySetName, System.Data.Objects.MergeOption mergeOption);
member this.Translate : System.Data.Common.DbDataReader * string * System.Data.Objects.MergeOption -> System.Data.Objects.ObjectResult<'Entity>
Public Function Translate(Of TEntity) (reader As DbDataReader, entitySetName As String, mergeOption As MergeOption) As ObjectResult(Of TEntity)
형식 매개 변수
- TEntity
DbDataReader에서 데이터의 엔터티 형식입니다.The entity type of the data in the DbDataReader.
매개 변수
- reader
- DbDataReader
엔터티 개체로 변환할 엔터티 데이터를 포함하는 DbDataReader입니다.The DbDataReader that contains entity data to translate into entity objects.
- entitySetName
- String
TEntity
형식의 엔터티 집합입니다.The entity set of the TEntity
type.
- mergeOption
- MergeOption
변환된 개체를 개체 컨텍스트에 추가할 때 사용하는 MergeOption입니다.The MergeOption to use when translated objects are added to the object context. 기본값은 AppendOnly입니다.The default is AppendOnly.
반환
- ObjectResult<TEntity>
TResult
형식의 개체 열거형입니다.An enumeration of objects of type TResult
.
예외
reader
가 null
일 경우When reader
is null
.
제공된 mergeOption
이 유효한 MergeOption 값이 아닌 경우When the supplied mergeOption
is not a valid MergeOption value.
제공된 entitySetName
이 TResult
형식에 대해 유효한 엔터티 집합이 아닌 경우When the supplied entitySetName
is not a valid entity set for the TResult
type.
설명
메서드는의 Translate 엔터티 데이터를 요청 된 형식의 개체로 변환 하는 데 사용 됩니다 DbDataReader .The Translate method is used to translate entity data from a DbDataReader into objects of the requested type. 이 프로세스는를 ObjectQuery<T> 실행 하 여 엔터티 데이터를 반환 하는 경우 자동으로 수행 됩니다.This process is performed automatically when an ObjectQuery<T> is executed to return entity data. Translate메서드를 사용 하면 데이터 원본에 대해 표준 ADO.NET 쿼리를 실행 하 고 반환 된 데이터 행을 엔터티 개체로 변환할 수 있습니다.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.
제공 된은 DbDataReader 요청 된 엔터티 형식에 매핑되는 데이터를 포함 해야 합니다.The supplied DbDataReader must contain data that maps to the requested entity type.
자세한 내용은 다음을 참조하세요.For more information, see:
저장소 명령 직접 실행Directly Executing Store Commands and
방법: 데이터 원본에 대해 명령 직접 실행How to: Directly Execute Commands Against the Data Source