/DataReaderMapper

Simple library for mapping IDataReader to class.

Primary LanguageC#MIT LicenseMIT

DataReaderMapper

Build status

Nuget link https://www.nuget.org/packages/Bharat.DataReaderMapper/

Simple example

var list = (new DataTable()).CreateDataReader().ProjectToEnumerable<Employee>().ToList();

With map

var mapper = DataReaderMap<Employee>.CreateMap();
var reader = (new DataTable()).CreateDataReader(); //example
var list = mapper.ProjectToEnumerable(reader).ToList();

public class Employee
{
    [Int32ValueConverter]
    [ColumnName("employeeID")]
    public int Id { set; get; }
    public string Name { get; set; }
    public DateTime AddedAt { set; get; }
    public DateTime UpdatedAt { set; get; }
}