diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index fc85e18..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/SharpApi/SharpApi/src/Helpers/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' @@ -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/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/SharpApi/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 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/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; + } } } 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