maestrianet - Maestria.Extensions.Data 1.1.3
Extension functions package for IDataReader implementations.
PM> Install-Package Maestria.Extensions.Data -Version 1.1.3 -Source https://www.myget.org/F/maestrianet/api/v3/index.json
> nuget.exe install Maestria.Extensions.Data -Version 1.1.3 -Source https://www.myget.org/F/maestrianet/api/v3/index.json
> dotnet add package Maestria.Extensions.Data --version 1.1.3 --source https://www.myget.org/F/maestrianet/api/v3/index.json
source https://www.myget.org/F/maestrianet/api/v3/index.json
nuget Maestria.Extensions.Data ~> 1.1.3
Copy to clipboard
> choco install Maestria.Extensions.Data --version 1.1.3 --source https://www.myget.org/F/maestrianet/api/v2
Import-Module PowerShellGet
Register-PSRepository -Name "maestrianet" -SourceLocation "https://www.myget.org/F/maestrianet/api/v2"
Install-Module -Name "Maestria.Extensions.Data" -RequiredVersion "1.1.3" -Repository "maestrianet"
Copy to clipboard
Maestria.Extensions.Data
What is Maestria.Extensions.Data?
Extension functions package for IDataReader implementations.
What is Maestria Project?
This library is part of Maestria Project.
Maestria is a project to provide maximum productivity and elegance to your code.
Where can I get it?
First, install NuGet. Then, install Maestria.Extensions.Data from the package manager console:
PM> Install-Package Maestria.Extensions.Data
or install from the dotnet cli command line:
> dotnet add package Maestria.Extensions.Data
How do I get started?
First, import "Maestria.Extensions.Data" reference:
using Maestria.Extensions.Data;
Then in your application code, use fluent syntax to obtain field value:
// Configuring data connection
var connection = // your .net data provider db connection
var cmd = connection.CreateCommand();
cmd.CommandText = "select * from...";
var reader = cmd.ExecuteReader();
reader.Read();
// In this case throw exception when field value is null
var int16Value = reader.GetInt16("fieldName");
var int32Value = reader.GetInt32("fieldName");
var decimalValue = reader.GetDecimal("fieldName");
// With safe method when field value is null, it will return default value of the second argument or INullable<?> for data type
var decimalSafeValue = reader.GetDecimalSafe("fieldName", 0); // output is 0 when invalid field value
var decimalSafeValue2 = reader.GetDecimalSafe("fieldName"); // output is nyll when invalid field value
// But safe methods, throw exception when field name is invalid
var temp = reader.GetDecimalSafe("invalid field name"); // throw IndexOutOfRangeException
If my contributions helped you, please help me buy a coffee :D
- .NETStandard 2.0: 2.0.0.0
OwnersFábio Naspolini |
AuthorsFábio Monteiro Naspolini |
Project URLhttps://github.com/MaestriaNet/Extensions.Data |
LicenseUnknown |
TagsData System.Data DataReader DbDataReader IDataReader IDataRecord Reader DataReaderExtensions Extensions Fluent Functional Elegance Productivity Maestria Mastery |
Info6 total downloads |
1 downloads for version 1.1.3 |
Download (11.46 KB) |
Found on the current feed only |
Package history
Version | Size | Last updated | Downloads | Mirrored? | |||
---|---|---|---|---|---|---|---|
1.1.3 | 11.46 KB | Sat, 27 Aug 2022 04:47:13 GMT | 1 | ||||
1.1.2 | 9.24 KB | Fri, 26 Aug 2022 05:32:13 GMT | 1 | ||||
1.1.1 | 6.94 KB | Fri, 26 Aug 2022 04:38:36 GMT | 1 | ||||
1.1.0 | 6.89 KB | Wed, 24 Aug 2022 16:47:26 GMT | 1 | ||||
1.0.5 | 6.9 KB | Wed, 24 Aug 2022 16:38:51 GMT | 2 |