C# Class OpenADK.Library.Tools.Mapping.DataReaderAdaptor

Implements IFieldAdaptor for the ADK, based on an IDataReader instance.
To use this class, create an instance of it based on an open IDataReader instance. You are responsible for navigation of the IDataReader by calling IDataReader.Read. When you are ready to map the current IDataReader row to a SIFElement, pass this class into the MappingsContext.MapOutbound() method.
Inheritance: IFieldAdaptor
ファイルを表示 Open project: nsip/SifBootCamp-dotNet Class Usage Examples

Public Methods

Method Description
DataReaderAdaptor ( IDataReader reader ) : System
GetSifValue ( string fieldName, TypeConverter typeConverter, FieldMapping mapping ) : SifSimpleType

Gets a value from the underlying data store to be used in an outbound field mapping operation

GetValue ( string key ) : object

Returns the underlying value being stored for the field.

This method is not called during Mappings operations. It may be called by classes such as the OpenADK.Library.IValueBuilder class

HasField ( string fieldName ) : bool

Returns whether the field being requested for mapping has a value that can be mapped to SIF

SetSifValue ( string fieldName, SifSimpleType value, FieldMapping mapping ) : void

Sets a value that has been retrieved from a SIF Element in an inbound field mapping operation.

Private Methods

Method Description
SafeGetOrdinal ( string key ) : int

Method Details

DataReaderAdaptor() public method

public DataReaderAdaptor ( IDataReader reader ) : System
reader IDataReader
return System

GetSifValue() public method

Gets a value from the underlying data store to be used in an outbound field mapping operation
public GetSifValue ( string fieldName, TypeConverter typeConverter, FieldMapping mapping ) : SifSimpleType
fieldName string The field name that is mapped to a SIFElement
typeConverter TypeConverter The converter class for the requested SIF data type
mapping FieldMapping The FieldMapping this value was generated from or null
return SifSimpleType

GetValue() public method

Returns the underlying value being stored for the field.
This method is not called during Mappings operations. It may be called by classes such as the OpenADK.Library.IValueBuilder class
public GetValue ( string key ) : object
key string
return object

HasField() public method

Returns whether the field being requested for mapping has a value that can be mapped to SIF
public HasField ( string fieldName ) : bool
fieldName string The field name being mapped to SIF
return bool

SetSifValue() public method

Sets a value that has been retrieved from a SIF Element in an inbound field mapping operation.
public SetSifValue ( string fieldName, SifSimpleType value, FieldMapping mapping ) : void
fieldName string The field name that is mapped to a SIFElement
value SifSimpleType The value of the SIF element
mapping FieldMapping The FieldMappings that will be used to set this value or null
return void