using System.Text.Json; namespace Kafka.Lib.Warehouse; public class ProducerChangeMessageType : IMessageType { public string? ProducerId { get; set; } public Dictionary Changes { get; set; } = new(); public string? Id { get; set; } public string? EventType { get; } = "ProducerChange"; public string Text { get { return JsonSerializer.Serialize(this); } set { if (string.IsNullOrEmpty(value)) { var obj = JsonSerializer.Deserialize(value); if (obj != null) { ProducerId = obj.ProducerId; Changes = obj.Changes; } } } } }