Skip to content

Commit

Permalink
handling bool values in sql value formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremydmiller committed Jul 24, 2024
1 parent 73de1d9 commit e09ed66
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public static string FormatSqlValue<T>(this T value)
{
if (typeof(T).IsNumeric()) return value.ToString();

if (value is bool b) return b.ToString().ToUpperInvariant();

if (value is string v && v.StartsWith("'") && v.EndsWith("'")) return v;

return $"'{value.ToString()}'";
Expand Down

0 comments on commit e09ed66

Please sign in to comment.