Skip to content

Commit

Permalink
Preserve older C# syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
henkmollema committed Mar 31, 2021
1 parent b46645b commit be56101
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Dommel.Json/JsonObjectTypeHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Dommel.Json
{
internal class JsonObjectTypeHandler : SqlMapper.ITypeHandler
{
private static readonly JsonSerializerOptions JsonOptions = new()
private static readonly JsonSerializerOptions JsonOptions = new JsonSerializerOptions()
{
AllowTrailingCommas = true,
ReadCommentHandling = JsonCommentHandling.Skip,
Expand All @@ -18,7 +18,7 @@ internal class JsonObjectTypeHandler : SqlMapper.ITypeHandler
public void SetValue(IDbDataParameter parameter, object? value)
{
parameter.Value = value is null || value is DBNull
? DBNull.Value
? (object)DBNull.Value
: JsonSerializer.Serialize(value, JsonOptions);
parameter.DbType = DbType.String;
}
Expand Down

0 comments on commit be56101

Please sign in to comment.