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.
This commit is contained in:
parent
9a71d2b805
commit
519df50404
@ -1,4 +1,6 @@
|
|||||||
namespace EnvelopeGenerator.Application.SQL;
|
using System.Globalization;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.SQL;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Extension method for converting objects to SQL parameter strings.
|
/// Extension method for converting objects to SQL parameter strings.
|
||||||
@ -19,7 +21,7 @@ public static class ParamsExtensions
|
|||||||
else if (obj is bool boolVal)
|
else if (obj is bool boolVal)
|
||||||
return boolVal ? "1" : "0";
|
return boolVal ? "1" : "0";
|
||||||
else if (obj is double doubleVal)
|
else if (obj is double doubleVal)
|
||||||
return $"'{doubleVal}'";
|
return $"'{doubleVal.ToString(CultureInfo.InvariantCulture)}'";
|
||||||
else if (obj is int intVal)
|
else if (obj is int intVal)
|
||||||
return intVal.ToString();
|
return intVal.ToString();
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user