Skip to content

Commit 40ba296

Browse files
AlexbitsBillWagner
authored andcommitted
Update domain-events-design-implementation.md (#4755)
Remove private setters to make a class truly immutable. Otherwise, properties can be updated outside of constructor. This also makes code cleaner.
1 parent e570c33 commit 40ba296

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/standard/microservices-architecture/microservice-ddd-cqrs-patterns/domain-events-design-implementation.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ In C#, a domain event is simply a data-holding structure or class, like a DTO, w
8484
```csharp
8585
public class OrderStartedDomainEvent : INotification
8686
{
87-
public string UserId { get; private set; }
88-
public int CardTypeId { get; private set; }
89-
public string CardNumber { get; private set; }
90-
public string CardSecurityNumber { get; private set; }
91-
public string CardHolderName { get; private set; }
92-
public DateTime CardExpiration { get; private set; }
93-
public Order Order { get; private set; }
87+
public string UserId { get; }
88+
public int CardTypeId { get; }
89+
public string CardNumber { get; }
90+
public string CardSecurityNumber { get; }
91+
public string CardHolderName { get; }
92+
public DateTime CardExpiration { get; }
93+
public Order Order { get; }
9494

9595
public OrderStartedDomainEvent(Order order,
9696
int cardTypeId, string cardNumber,

0 commit comments

Comments
 (0)