From ea5fd7c7056a11171321f91ed36894ea16cfbbf3 Mon Sep 17 00:00:00 2001 From: Maxwell Weru Date: Fri, 26 May 2023 13:17:44 +0300 Subject: [PATCH] Add setter for serializable types to allow JSON source generators --- .../Serialization/EventEnvelope.cs | 18 +++++++++--------- src/Tingle.EventBus/Serialization/HostInfo.cs | 12 ++++++------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Tingle.EventBus/Serialization/EventEnvelope.cs b/src/Tingle.EventBus/Serialization/EventEnvelope.cs index 70f0c408..cb1d17bc 100644 --- a/src/Tingle.EventBus/Serialization/EventEnvelope.cs +++ b/src/Tingle.EventBus/Serialization/EventEnvelope.cs @@ -6,28 +6,28 @@ public class EventEnvelope : IEventEnvelope { /// - public string? Id { get; init; } + public string? Id { get; set; } /// - public string? RequestId { get; init; } + public string? RequestId { get; set; } /// - public string? CorrelationId { get; init; } + public string? CorrelationId { get; set; } /// - public string? InitiatorId { get; init; } + public string? InitiatorId { get; set; } /// - public DateTimeOffset? Expires { get; init; } + public DateTimeOffset? Expires { get; set; } /// - public DateTimeOffset? Sent { get; init; } + public DateTimeOffset? Sent { get; set; } /// - public IDictionary Headers { get; init; } = new Dictionary(StringComparer.OrdinalIgnoreCase); + public IDictionary Headers { get; set; } = new Dictionary(StringComparer.OrdinalIgnoreCase); /// - public HostInfo? Host { get; init; } + public HostInfo? Host { get; set; } } /// @@ -36,5 +36,5 @@ public class EventEnvelope : IEventEnvelope public class EventEnvelope : EventEnvelope, IEventEnvelope where T : class { /// - public T? Event { get; init; } + public T? Event { get; set; } } diff --git a/src/Tingle.EventBus/Serialization/HostInfo.cs b/src/Tingle.EventBus/Serialization/HostInfo.cs index 6ba6484b..a67227f4 100644 --- a/src/Tingle.EventBus/Serialization/HostInfo.cs +++ b/src/Tingle.EventBus/Serialization/HostInfo.cs @@ -9,35 +9,35 @@ public record HostInfo /// The machine name (or role instance name) of the machine. /// /// WIN-HQ1243 - public virtual string? MachineName { get; init; } + public virtual string? MachineName { get; set; } /// /// The name of the application. /// /// Tingle.EventBus.Examples.SimplePublisher - public virtual string? ApplicationName { get; init; } + public virtual string? ApplicationName { get; set; } /// /// The version of the application. /// /// 1.0.0.0 - public virtual string? ApplicationVersion { get; init; } + public virtual string? ApplicationVersion { get; set; } /// /// The name of the environment the application is running in. /// /// Production - public virtual string? EnvironmentName { get; init; } + public virtual string? EnvironmentName { get; set; } /// /// The version of the library. /// /// 1.0.0.0 - public virtual string? LibraryVersion { get; init; } + public virtual string? LibraryVersion { get; set; } /// /// The operating system hosting the application. /// /// Microsoft Windows NT 10.0.19042.0 - public virtual string? OperatingSystem { get; init; } + public virtual string? OperatingSystem { get; set; } }