public static void WriteToFile(this IJsonSerializable serializable, string filePath, IDiagnosticLogger?logger) { using var file = File.Create(filePath); using var writer = new Utf8JsonWriter(file); serializable.WriteTo(writer, logger); writer.Flush(); }
public static void WriteSerializableValue( this Utf8JsonWriter writer, IJsonSerializable value) { value.WriteTo(writer); }