Skip to content

Commit 4e97166

Browse files
committed
[Bug] Deserialization of IntegrationEvent dotnet-architecture#667
dotnet-architecture#667
1 parent bb8dd63 commit 4e97166

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

src/BuildingBlocks/EventBus/EventBus/Events/IntegrationEvent.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using Newtonsoft.Json;
23

34
namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events
45
{
@@ -10,7 +11,17 @@ public IntegrationEvent()
1011
CreationDate = DateTime.UtcNow;
1112
}
1213

13-
public Guid Id { get; }
14-
public DateTime CreationDate { get; }
14+
[JsonConstructor]
15+
public IntegrationEvent(Guid id, DateTime createDate)
16+
{
17+
Id = id;
18+
CreationDate = createDate;
19+
}
20+
21+
[JsonProperty]
22+
public Guid Id { get; private set; }
23+
24+
[JsonProperty]
25+
public DateTime CreationDate { get; private set; }
1526
}
1627
}

0 commit comments

Comments
 (0)