diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/IOL.Helpers/CryptographyHelpers.cs | 1 | ||||
| -rw-r--r-- | src/IOL.Helpers/IOL.Helpers.csproj | 8 | ||||
| -rw-r--r-- | src/IOL.Helpers/StringHelpers.cs | 9 |
3 files changed, 12 insertions, 6 deletions
diff --git a/src/IOL.Helpers/CryptographyHelpers.cs b/src/IOL.Helpers/CryptographyHelpers.cs index 4821613..df53055 100644 --- a/src/IOL.Helpers/CryptographyHelpers.cs +++ b/src/IOL.Helpers/CryptographyHelpers.cs @@ -155,7 +155,6 @@ public static class CryptographyHelpers return Convert.ToBase64String(hash); } - /// <summary> /// Creates a SHA256 hash of the specified input. /// </summary> diff --git a/src/IOL.Helpers/IOL.Helpers.csproj b/src/IOL.Helpers/IOL.Helpers.csproj index 2bd3b45..2310989 100644 --- a/src/IOL.Helpers/IOL.Helpers.csproj +++ b/src/IOL.Helpers/IOL.Helpers.csproj @@ -19,10 +19,10 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="6.0.0"/> - <PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0"/> - <PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0"/> - <PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0"/> + <PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="6.0.1" /> + <PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" /> + <PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0" /> + <PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0" /> </ItemGroup> </Project> diff --git a/src/IOL.Helpers/StringHelpers.cs b/src/IOL.Helpers/StringHelpers.cs index 783d238..366ca00 100644 --- a/src/IOL.Helpers/StringHelpers.cs +++ b/src/IOL.Helpers/StringHelpers.cs @@ -17,6 +17,10 @@ public static class StringHelpers return Slug.Generate(true, input); } + public static string ToSnakeCase(this string str) { + return string.Concat(str.Select((x, i) => i > 0 && char.IsUpper(x) ? "_" + x : x.ToString())).ToLower(); + } + public static bool HasValue(this string value) { return !value.IsNullOrWhiteSpace(); } @@ -26,7 +30,6 @@ public static class StringHelpers return values.Count == 0 ? default : values.Aggregate(input, (current, value1) => current.Replace("{" + value1.Key + "}", value1.Value)); } - public static string UnicornFormatWithEnvironment(this string input, IConfiguration configuration) { if (string.IsNullOrWhiteSpace(input)) return default; var matchList = Regex.Matches(input, "{[a-z|_]*}", RegexOptions.IgnoreCase); @@ -40,6 +43,10 @@ public static class StringHelpers } public static Guid ToGuid(this string value) { + return new Guid(value); + } + + public static Guid ToGuidOrDefault(this string value) { return !Guid.TryParse(value, out var res) ? default : res; } |
