Browse Source

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
pull/552/head
Alex Kryvdyk 6 years ago
committed by GitHub
parent
commit
a0eb95e001
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/Services/Ordering/Ordering.Domain/SeedWork/Enumeration.cs

+ 2
- 2
src/Services/Ordering/Ordering.Domain/SeedWork/Enumeration.cs View File

@ -7,9 +7,9 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork
{ {
public abstract class Enumeration : IComparable 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() protected Enumeration()
{ {


Loading…
Cancel
Save