Skip to content

Commit 87c1ae2

Browse files
committed
Core.Sql added
1 parent 7a1dd6e commit 87c1ae2

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System.Data.SqlClient;
2+
3+
namespace KY.Core.Sql.Extensions
4+
{
5+
public static class SqlDataReaderExtension
6+
{
7+
public static int GetInt32(this SqlDataReader reader, int ordinal, int nullValue)
8+
{
9+
return reader.IsDBNull(ordinal) ? nullValue : reader.GetInt32(ordinal);
10+
}
11+
12+
public static string GetString(this SqlDataReader reader, int ordinal, string nullValue)
13+
{
14+
return reader.IsDBNull(ordinal) ? nullValue : reader.GetString(ordinal);
15+
}
16+
17+
public static byte GetByte(this SqlDataReader reader, int ordinal, byte nullValue)
18+
{
19+
return reader.IsDBNull(ordinal) ? nullValue : reader.GetByte(ordinal);
20+
}
21+
}
22+
}

Core.Sql/KY.Core.Sql.csproj

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netstandard2.0</TargetFramework>
5+
<Authors>KY-Programming</Authors>
6+
<Company>KY-Programming</Company>
7+
<Product>KY.Core</Product>
8+
<Version>5.0.0</Version>
9+
<Description>KY.Core.Sql for .net Standard</Description>
10+
<Copyright>2019 - KY-Programming</Copyright>
11+
<PackageLicenseExpression>GPL-3.0-or-later</PackageLicenseExpression>
12+
<PackageProjectUrl>https://github.com/KY-Programming/core</PackageProjectUrl>
13+
<PackageIconUrl>https://ky-programming.de/images/logos/128.png</PackageIconUrl>
14+
<RepositoryUrl>https://github.com/KY-Programming/core</RepositoryUrl>
15+
<PackageTags>KY Core SQL</PackageTags>
16+
</PropertyGroup>
17+
18+
<ItemGroup>
19+
<PackageReference Include="KY.Core.Common" Version="4.4.0" />
20+
<PackageReference Include="System.Data.SqlClient" Version="4.6.0" />
21+
</ItemGroup>
22+
23+
</Project>

0 commit comments

Comments
 (0)