Skip to content

Commit

Permalink
feat: Initial implementation (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
samtrion authored Nov 5, 2024
1 parent 5532827 commit fa50ad4
Show file tree
Hide file tree
Showing 21 changed files with 2,872 additions and 21 deletions.
1 change: 0 additions & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
name: Build & Tests
uses: dailydevops/pipelines/.github/workflows/[email protected]
with:
disablePublish: true
dotnet-logging: ${{ inputs.dotnet-logging }}
dotnet-version: ${{ vars.NE_DOTNET_TARGETFRAMEWORKS }}
solution: ./Extensions.Data.sln
Expand Down
6 changes: 4 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
</PropertyGroup>

<PropertyGroup>
<NetEvolve_ProjectTargetFrameworks>net6.0;net8.0</NetEvolve_ProjectTargetFrameworks>
<NetEvolve_TestTargetFrameworks>net6.0;net8.0</NetEvolve_TestTargetFrameworks>
<NetEvolve_ProjectTargetFrameworks>netstandard2.0;net8.0;net9.0</NetEvolve_ProjectTargetFrameworks>
<NetEvolve_TestTargetFrameworks>net6.0;net8.0;net9.0</NetEvolve_TestTargetFrameworks>

<NoWarn Condition=" '$(TargetFramework)' == 'netstandard2.0' ">$(NoWarn);CA1062;</NoWarn>
</PropertyGroup>

<PropertyGroup>
Expand Down
10 changes: 5 additions & 5 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<Project>

<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
</PropertyGroup>

<ItemGroup>
<GlobalPackageReference Include="CSharpier.MSBuild" Version="0.29.2" />
<GlobalPackageReference Include="GitVersion.MsBuild" Version="6.0.4" />
Expand All @@ -14,14 +12,16 @@
<GlobalPackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.11.20" />
<GlobalPackageReference Include="SonarAnalyzer.CSharp" Version="9.32.0.97167" Condition=" '$(BuildingInsideVisualStudio)' == 'true' " />
</ItemGroup>

<ItemGroup>
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.2" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="NetEvolve.Arguments" Version="1.2.100" />
<PackageVersion Include="NetEvolve.Extensions.XUnit" Version="2.3.1" />
<PackageVersion Include="NSubstitute" Version="5.3.0" />
<PackageVersion Include="PublicApiGenerator" Version="11.1.0" />
<PackageVersion Include="Verify.Xunit" Version="27.1.0" />
<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
</ItemGroup>

</Project>
</Project>
10 changes: 10 additions & 0 deletions Extensions.Data.sln
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{F13F80C7
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetEvolve.Extensions.Data.Tests.Unit", "tests\NetEvolve.Extensions.Data.Tests.Unit\NetEvolve.Extensions.Data.Tests.Unit.csproj", "{C8A78C6C-514E-4FF5-ABAD-1DE2FF63D751}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetEvolve.Extensions.Data.Tests.PublicApi", "tests\NetEvolve.Extensions.Data.Tests.PublicApi\NetEvolve.Extensions.Data.Tests.PublicApi.csproj", "{7466A217-FD99-4C9B-8393-B3DCC4198539}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -45,12 +47,20 @@ Global
{C8A78C6C-514E-4FF5-ABAD-1DE2FF63D751}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C8A78C6C-514E-4FF5-ABAD-1DE2FF63D751}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C8A78C6C-514E-4FF5-ABAD-1DE2FF63D751}.Release|Any CPU.Build.0 = Release|Any CPU
{7466A217-FD99-4C9B-8393-B3DCC4198539}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7466A217-FD99-4C9B-8393-B3DCC4198539}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7466A217-FD99-4C9B-8393-B3DCC4198539}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7466A217-FD99-4C9B-8393-B3DCC4198539}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{F04DA615-A3D2-4C39-A73A-86ED6F571AA7} = {65A2AFCB-601E-48B3-89B9-69AC19957F59}
{C8A78C6C-514E-4FF5-ABAD-1DE2FF63D751} = {F13F80C7-A67B-4680-BB2B-BE124C49DF56}
{7466A217-FD99-4C9B-8393-B3DCC4198539} = {F13F80C7-A67B-4680-BB2B-BE124C49DF56}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {575B3FE1-8503-45D4-B916-6C8D197C13D7}
EndGlobalSection
EndGlobal
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
# template-dotnet
.NET template for repositories
# NetEvolve.Extensions.Data

This package contains multiple extensions for native Components from the .NET Framework, especially for the `System.Data` namespace.

The main goal of this package is to provide a set of time-saving methods, to simplify the development in context of data handling.

## Installation

To install this package, you can use the NuGet Package Manager in Visual Studio or the `dotnet` CLI.

```bash
dotnet add package NetEvolve.Extensions.Data
```

## Usage

All extensions are available in the `NetEvolve.Extensions.Data` namespace.
3 changes: 0 additions & 3 deletions src/NetEvolve.Extensions.Data/Class1.cs

This file was deleted.

26 changes: 26 additions & 0 deletions src/NetEvolve.Extensions.Data/IDataReaderExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
namespace NetEvolve.Extensions.Data;

using System.Data;
using NetEvolve.Arguments;

/// <summary>
/// Provides a set of extension methods for <see cref="IDataReader"/>.
/// </summary>
public static class IDataReaderExtensions
{
/// <summary>
/// Determines whether the <see cref="IDataReader"/> contains a column with the specified name.
/// </summary>
/// <param name="reader">The <see cref="IDataReader"/> to check.</param>
/// <param name="name">The name of the column to find.</param>
/// <returns><see langword="true"/> if the <see cref="IDataReader"/> contains a column with the specified name; otherwise, <see langword="false"/>.</returns>
public static bool HasColumn(this IDataReader reader, string name)
{
Argument.ThrowIfNull(reader);
Argument.ThrowIfNullOrWhiteSpace(name);

return Enumerable
.Range(0, reader.FieldCount)
.Any(i => reader.GetName(i).Equals(name, StringComparison.OrdinalIgnoreCase));
}
}
Loading

0 comments on commit fa50ad4

Please sign in to comment.