Simplified calling code to not rely on extension methods
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user