Remove private setters to make class immutable
Remove private setters to make Enumeration immutable. Otherwise, it's possible to change the property values. ```csharp public override string ToString() { Name = "Whatever"; return Name; } ``` ## Summary Remove private setters for public properties
This commit is contained in:
parent
672d7186d1
commit
a0eb95e001
@ -7,9 +7,9 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork
|
||||
{
|
||||
public abstract class Enumeration : IComparable
|
||||
{
|
||||
public string Name { get; private set; }
|
||||
public string Name { get; }
|
||||
|
||||
public int Id { get; private set; }
|
||||
public int Id { get; }
|
||||
|
||||
protected Enumeration()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user