From 519df50404c45609cc65577421dc75ef023972c6 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Wed, 7 May 2025 15:35:14 +0200 Subject: [PATCH] Add culture-specific formatting for SQL parameters Updated ParamsExtensions to include System.Globalization for culture-invariant formatting of double values. This change ensures proper SQL parameterization by avoiding issues with decimal separators across different cultures. --- EnvelopeGenerator.Application/SQL/ParamsExtensions.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/EnvelopeGenerator.Application/SQL/ParamsExtensions.cs b/EnvelopeGenerator.Application/SQL/ParamsExtensions.cs index 2558eb5e..9f8ad1ec 100644 --- a/EnvelopeGenerator.Application/SQL/ParamsExtensions.cs +++ b/EnvelopeGenerator.Application/SQL/ParamsExtensions.cs @@ -1,4 +1,6 @@ -namespace EnvelopeGenerator.Application.SQL; +using System.Globalization; + +namespace EnvelopeGenerator.Application.SQL; /// /// Extension method for converting objects to SQL parameter strings. @@ -19,7 +21,7 @@ public static class ParamsExtensions else if (obj is bool boolVal) return boolVal ? "1" : "0"; else if (obj is double doubleVal) - return $"'{doubleVal}'"; + return $"'{doubleVal.ToString(CultureInfo.InvariantCulture)}'"; else if (obj is int intVal) return intVal.ToString(); else