mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-03 00:29:20 +00:00
28 lines
798 B
C#
28 lines
798 B
C#
using System;
|
|
using System.Text.Json;
|
|
|
|
namespace DiscordChatExporter.Domain.Internal
|
|
{
|
|
internal static class Utf8JsonWriterExtensions
|
|
{
|
|
public static void WriteString(this Utf8JsonWriter writer, string propertyName, DateTimeOffset? value)
|
|
{
|
|
writer.WritePropertyName(propertyName);
|
|
|
|
if (value != null)
|
|
writer.WriteStringValue(value.Value);
|
|
else
|
|
writer.WriteNullValue();
|
|
}
|
|
|
|
public static void WriteNumber(this Utf8JsonWriter writer, string propertyName, int? value)
|
|
{
|
|
writer.WritePropertyName(propertyName);
|
|
|
|
if (value != null)
|
|
writer.WriteNumberValue(value.Value);
|
|
else
|
|
writer.WriteNullValue();
|
|
}
|
|
}
|
|
} |