Create C# projects

This commit is contained in:
2024-08-18 16:27:33 -03:00
parent 16c9711596
commit 30075eca9a
16 changed files with 254 additions and 2 deletions

View File

@@ -0,0 +1,22 @@
// Copyright (c) Tribufu. All Rights Reserved.
// SPDX-License-Identifier: MIT
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Tribufu.Serialization
{
public class DecimalStringConverter : JsonConverter<decimal>
{
public override decimal Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return Convert.ToUInt64(reader.GetString());
}
public override void Write(Utf8JsonWriter writer, decimal value, JsonSerializerOptions options)
{
writer.WriteStringValue(value.ToString());
}
}
}