Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit ed26c33

Browse files
authored
Remove private setters to make class immutable
Remove private setters to make a class truly immutable. Otherwise, properties can be updated outside of constructor. This also makes code cleaner. Same in docs dotnet/docs#4755
1 parent 455b256 commit ed26c33

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Services/Ordering/Ordering.Domain/Events/OrderStartedDomainEvent.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ namespace Ordering.Domain.Events
1111
/// </summary>
1212
public class OrderStartedDomainEvent : INotification
1313
{
14-
public string UserId { get; private set; }
15-
public int CardTypeId { get; private set; }
16-
public string CardNumber { get; private set; }
17-
public string CardSecurityNumber { get; private set; }
18-
public string CardHolderName { get; private set; }
19-
public DateTime CardExpiration { get; private set; }
20-
public Order Order { get; private set; }
14+
public string UserId { get; }
15+
public int CardTypeId { get; }
16+
public string CardNumber { get; }
17+
public string CardSecurityNumber { get; }
18+
public string CardHolderName { get; }
19+
public DateTime CardExpiration { get; }
20+
public Order Order { get; }
2121

2222
public OrderStartedDomainEvent(Order order, string userId,
2323
int cardTypeId, string cardNumber,

0 commit comments

Comments
 (0)