From 6a2babc268797c5b61c9b0de1f7b855925d4292a Mon Sep 17 00:00:00 2001 From: ivano scifoni Date: Wed, 17 Mar 2021 13:52:39 +0100 Subject: [PATCH 1/6] align (#4) * Master align (#3) Update dotnet.yml repository url property * Update dotnet.yml --- .github/workflows/dotnet.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index fc85e18..fae2540 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -57,7 +57,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: nupkg - path: /home/runner/work/SharpApi/SharpApi/src/Helpers/src/SharpApi.Helpers/bin/Release/*.nupkg + path: /home/runner/work/SharpCodeApi/SharpApi/src/Helpers/src/SharpApi.Helpers/bin/Release/*.nupkg prerelease: needs: build if: github.ref == 'refs/heads/develop' @@ -70,7 +70,7 @@ jobs: - name: Add GPR Source run: nuget sources add -name "GPR" -Source $GITHUB_FEED -Username $GITHUB_USER -Password $GITHUB_TOKEN - name: nuget push - run: dotnet nuget push /home/runner/work/SharpApi/SharpApi/nupkg/**/bin/Release/*.nupkg --source $GITHUB_FEED --api-key $GITHUB_TOKEN --skip-duplicate --no-symbols true + run: dotnet nuget push /home/runner/work/SharpCodeApi/SharpApi/nupkg/**/bin/Release/*.nupkg --source $GITHUB_FEED --api-key $GITHUB_TOKEN --skip-duplicate --no-symbols true deploy: needs: build if: github.event_name == 'release' && startsWith(github.ref, 'refs/heads/v') @@ -81,4 +81,4 @@ jobs: with: name: nupkg - name: Push to NuGet Feed - run: dotnet nuget push /home/runner/work/SharpApi/SharpApi/nupkg/**/bin/Release/*.nupkg --source $NUGET_FEED --skip-duplicate --api-key $NUGET_KEY + run: dotnet nuget push /home/runner/work/SharpCodeApi/SharpApi/nupkg/**/bin/Release/*.nupkg --source $NUGET_FEED --skip-duplicate --api-key $NUGET_KEY From 45b28f1900a7121ecb62b78743f3b5068f08752d Mon Sep 17 00:00:00 2001 From: ivano scifoni Date: Wed, 17 Mar 2021 14:01:31 +0100 Subject: [PATCH 2/6] Update dotnet.yml --- .github/workflows/dotnet.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index fae2540..fbd49a0 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -57,7 +57,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: nupkg - path: /home/runner/work/SharpCodeApi/SharpApi/src/Helpers/src/SharpApi.Helpers/bin/Release/*.nupkg + path: /home/runner/work/SharpCodingApi/SharpCodingApi/src/Helpers/src/SharpApi.Helpers/bin/Release/*.nupkg prerelease: needs: build if: github.ref == 'refs/heads/develop' @@ -70,7 +70,7 @@ jobs: - name: Add GPR Source run: nuget sources add -name "GPR" -Source $GITHUB_FEED -Username $GITHUB_USER -Password $GITHUB_TOKEN - name: nuget push - run: dotnet nuget push /home/runner/work/SharpCodeApi/SharpApi/nupkg/**/bin/Release/*.nupkg --source $GITHUB_FEED --api-key $GITHUB_TOKEN --skip-duplicate --no-symbols true + run: dotnet nuget push /home/runner/work/SharpCodingApi/SharpCodingApi/nupkg/**/bin/Release/*.nupkg --source $GITHUB_FEED --api-key $GITHUB_TOKEN --skip-duplicate --no-symbols true deploy: needs: build if: github.event_name == 'release' && startsWith(github.ref, 'refs/heads/v') @@ -81,4 +81,4 @@ jobs: with: name: nupkg - name: Push to NuGet Feed - run: dotnet nuget push /home/runner/work/SharpCodeApi/SharpApi/nupkg/**/bin/Release/*.nupkg --source $NUGET_FEED --skip-duplicate --api-key $NUGET_KEY + run: dotnet nuget push /home/runner/work/SharpCodingApi/SharpCodingApi/nupkg/**/bin/Release/*.nupkg --source $NUGET_FEED --skip-duplicate --api-key $NUGET_KEY From e4775aa64c843fca794d819aafd7f0b1e8380395 Mon Sep 17 00:00:00 2001 From: ivano scifoni Date: Wed, 17 Mar 2021 14:06:12 +0100 Subject: [PATCH 3/6] Update dotnet.yml --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index fbd49a0..976b8ac 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -57,7 +57,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: nupkg - path: /home/runner/work/SharpCodingApi/SharpCodingApi/src/Helpers/src/SharpApi.Helpers/bin/Release/*.nupkg + path: /home/runner/work/SharpCodingApi/SharpCodingApi/src/**/src/SharpApi.Helpers/bin/Release/*.nupkg prerelease: needs: build if: github.ref == 'refs/heads/develop' From 1364d3fcc3ef0747ecd165e2f230126e8b34c57d Mon Sep 17 00:00:00 2001 From: Ivano Scifoni Date: Wed, 17 Mar 2021 15:01:22 +0100 Subject: [PATCH 4/6] Fix repositoryname --- src/Helpers/src/SharpApi.Helpers/SharpApi.Helpers.csproj | 4 ++-- src/Utility/src/SharpApi.Utility/SharpApi.Utility.csproj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Helpers/src/SharpApi.Helpers/SharpApi.Helpers.csproj b/src/Helpers/src/SharpApi.Helpers/SharpApi.Helpers.csproj index 169aaca..f382499 100644 --- a/src/Helpers/src/SharpApi.Helpers/SharpApi.Helpers.csproj +++ b/src/Helpers/src/SharpApi.Helpers/SharpApi.Helpers.csproj @@ -3,8 +3,8 @@ netstandard2.1 annotations - https://github.com/sharpcode-it/SharpApi - https://github.com/sharpcode-it/SharpApi + https://github.com/sharpcode-it/SharpCodingApi + https://github.com/sharpcode-it/SharpCodingApi github diff --git a/src/Utility/src/SharpApi.Utility/SharpApi.Utility.csproj b/src/Utility/src/SharpApi.Utility/SharpApi.Utility.csproj index c977e57..fd3d471 100644 --- a/src/Utility/src/SharpApi.Utility/SharpApi.Utility.csproj +++ b/src/Utility/src/SharpApi.Utility/SharpApi.Utility.csproj @@ -2,8 +2,8 @@ netstandard2.1 - https://github.com/sharpcode-it/SharpApi - https://github.com/sharpcode-it/SharpApi + https://github.com/sharpcode-it/SharpCodingApi + https://github.com/sharpcode-it/SharpCodingApi From a0683efbaed6f2a937ef828073f7e9d3dc247fe4 Mon Sep 17 00:00:00 2001 From: ivano scifoni Date: Wed, 17 Mar 2021 15:05:51 +0100 Subject: [PATCH 5/6] Update dotnet.yml --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 976b8ac..e8796da 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -57,7 +57,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: nupkg - path: /home/runner/work/SharpCodingApi/SharpCodingApi/src/**/src/SharpApi.Helpers/bin/Release/*.nupkg + path: /home/runner/work/SharpCodingApi/SharpCodingApi/src/**/src/**/bin/Release/*.nupkg prerelease: needs: build if: github.ref == 'refs/heads/develop' From de263b6c21234d13f9b3ffc9e7d8927ab1a80c29 Mon Sep 17 00:00:00 2001 From: engineering87 Date: Sat, 20 Mar 2021 16:18:28 +0100 Subject: [PATCH 6/6] Add some helpers to Numeric --- .../ValueTypeExtensions/NumericHelper.cs | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/Helpers/src/SharpApi.Helpers/ValueTypeExtensions/NumericHelper.cs b/src/Helpers/src/SharpApi.Helpers/ValueTypeExtensions/NumericHelper.cs index ab80787..de04f06 100644 --- a/src/Helpers/src/SharpApi.Helpers/ValueTypeExtensions/NumericHelper.cs +++ b/src/Helpers/src/SharpApi.Helpers/ValueTypeExtensions/NumericHelper.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; namespace SharpApi.Helpers.ValueTypeExtensions { @@ -20,5 +18,31 @@ public static bool IsWithin(this long value, long minimum, long maximum) { return value >= minimum && value <= maximum; } + + public static bool IsWithin(this double value, double minimum, double maximum) + { + return value >= minimum && value <= maximum; + } + + public static bool IsOdd(this int value) + { + return (value % 2) != 0; + } + + public static bool IsEven(this int value) + { + return !value.IsOdd(); + } + + public static bool IsPrime(this int value) + { + var limit = Math.Ceiling(Math.Sqrt(value)); + for (var i = 2; i <= limit; i++) + { + if (value % i == 0) + return false; + } + return true; + } } }