diff --git a/Netch/Models/ParameterBase.cs b/Netch/Models/ParameterBase.cs index 4ecbb2a5..52d2e06f 100644 --- a/Netch/Models/ParameterBase.cs +++ b/Netch/Models/ParameterBase.cs @@ -1,7 +1,6 @@ using System; using System.Linq; using System.Reflection; -using Netch.Utils; namespace Netch.Models { @@ -49,7 +48,7 @@ namespace Netch.Models case bool b: return b ? $"{prefix}{key}" : null; default: - if ((value?.ToString() ?? null).IsNullOrWhiteSpace()) + if (string.IsNullOrWhiteSpace(value?.ToString())) return p.IsDefined(typeof(OptionalAttribute)) ? null : throw new RequiredArgumentValueInvalidException(p.Name, this, null); if (p.IsDefined(typeof(QuoteAttribute))) diff --git a/Netch/Utils/Utils.cs b/Netch/Utils/Utils.cs index 2d4e0f97..4f817238 100644 --- a/Netch/Utils/Utils.cs +++ b/Netch/Utils/Utils.cs @@ -106,7 +106,7 @@ namespace Netch.Utils { var sha256 = SHA256.Create(); using var fileStream = File.OpenRead(filePath); - return sha256.ComputeHash(fileStream).Aggregate(string.Empty, (current, b) => current + b.ToString("x2")); + return string.Concat(sha256.ComputeHash(fileStream).Select(b => b.ToString("x2"))); } catch {