Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Latest commit

 

History

History
54 lines (39 loc) · 1.9 KB

File metadata and controls

54 lines (39 loc) · 1.9 KB

TypeMap class

This class help mapping IDataReader content to interface marked with ConcreteAttribute.

Declaration

public class TypeMap<T>
{
    public static T CreateConcrete();
    public static T ReadCurrentRow(IDataReader reader);
    public static IList<T> ReadSingleResultset(IDataReader reader);
    public static T ReadMultiResultset(IDataReader reader, params string[] properties);
}

Generic parameters

T

Description: T is an interface that marked with ConcreteAttribute.

Methdos

public static T CreateConcrete();

Description: create object that implement the interface.

public static T ReadCurrentRow(IDataReader reader);

Description: read row at current position from input data reader and return active object.

reader: data reader with Read function called before this function.

public static IList<T> ReadSingleResultset(IDataReader reader);

Description: read all rows from input data reader and return list of rows.

reader: active IDataReader to call its Read function to pull the data.

public static T ReadMultiResultset(IDataReader reader, params string[] properties);

Description: read all result sets from input data reader and bound them to object.

reader: IDataReader to read data. properties: list of properties to bound the resultset.

Please refer to Examples section in Documentation page.