SqlDataReaderMapper 1.0.5

dotnet add package SqlDataReaderMapper --version 1.0.5                
NuGet\Install-Package SqlDataReaderMapper -Version 1.0.5                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SqlDataReaderMapper" Version="1.0.5" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SqlDataReaderMapper --version 1.0.5                
#r "nuget: SqlDataReaderMapper, 1.0.5"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SqlDataReaderMapper as a Cake Addin
#addin nuget:?package=SqlDataReaderMapper&version=1.0.5

// Install SqlDataReaderMapper as a Cake Tool
#tool nuget:?package=SqlDataReaderMapper&version=1.0.5                

SqlDataReader mapper

Simple C# SqlDataReader object mapper. Allows you to map a SqlDataReader to the particular class.

Supports simple property mapping, property name transformations, string trimming, manual property binding by name, type changing, function binding, etc.

Installing SqlDataReaderMapper

You should install SqlDataReaderMapper:

PM> Install-Package SqlDataReaderMapper

Or via the .NET Core command line interface:

PM> dotnet add package SqlDataReaderMapper

Either commands, from Package Manager Console or .NET Core CLI, will download and install SqlDataReaderMapper and all required dependencies.

Getting started

Then, use the library in the project:

    using SqlDataReaderMapper;

Here is an example of the usage:

    var mappedObject = new SqlDataReaderMapper<UserDto>(reader)
         .NameTransformers("_", "")
         .IgnoreAllNonExisting()
         .ForMember<int>("CurrencyId")
         .ForMember("CurrencyCode", "Code")
         .ForMember<string>("CreatedByUser", "User").Trim()
         .ForMemberManual("CountryCode", val => val.ToString().Substring(0, 10))
         .ForMemberManual("ZipCode", val => val.ToString().Substring(0, 5), "ZIP")
         .Build();

Or simply:

    var mappedObject = new SqlDataReaderMapper<UserDto>(reader)
         .Build();

Copyright © 2019 Grigory and contributors.

License

SqlDataReaderMapper is licensed under GPL-3.0. Refer to LICENSE for more information.

What's next

I'm planning to make this library static.

Product Compatible and additional computed target framework versions.
.NET Framework net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.6.1

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.5 30,147 7/5/2020
1.0.4 64,398 3/2/2019
1.0.2 737 2/12/2019