Simplified calling code to not rely on extension methods

This commit is contained in:
Kenneth Skovhede
2025-09-25 11:33:56 +02:00
parent 4b1d2f1538
commit 39cca5c24f
2 changed files with 3 additions and 3 deletions
@@ -778,7 +778,7 @@ public static partial class ExtensionMethods
else if (p.Value is byte[] bytes)
v = Library.Utility.Utility.FormatInvariantFormattable($"X'{BitConverter.ToString(bytes).Replace("-", "")}'");
else
v = p.Value?.FormatInvariantValue() ?? "NULL";
v = Library.Utility.Utility.FormatInvariantValue(p.Value);
// Replace all occurrences of the parameter (with word boundary)
txt = Regex.Replace(txt, $@"\B{Regex.Escape(paramName)}\b", v, RegexOptions.IgnoreCase);
+2 -2
View File
@@ -1660,7 +1660,7 @@ namespace Duplicati.Library.Utility
/// </summary>
/// <param name="formattable">The formattable string</param>
/// <returns>The formatted string</returns>
public static string FormatInvariantFormattable(this FormattableString formattable)
public static string FormatInvariantFormattable(FormattableString formattable)
=> formattable.ToString(CultureInfo.InvariantCulture);
/// <summary>
@@ -1670,7 +1670,7 @@ namespace Duplicati.Library.Utility
/// <typeparam name="T">The type of the value.</typeparam>
/// <param name="value">The value to format.</param>
/// <returns>The formatted string.</returns>
public static string FormatInvariantValue<T>(this T value)
public static string FormatInvariantValue<T>(T value)
=> value is IFormattable f
? f.ToString(null, CultureInfo.InvariantCulture)
: string.Format(CultureInfo.InvariantCulture, "{0}", value);