Browse Source

Update Enumeration

pull/704/head
Petr Onderka 6 years ago
parent
commit
488c607a7e
2 changed files with 4 additions and 11 deletions
  1. +0
    -4
      src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/OrderStatus.cs
  2. +4
    -7
      src/Services/Ordering/Ordering.Domain/SeedWork/Enumeration.cs

+ 0
- 4
src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/OrderStatus.cs View File

@ -17,10 +17,6 @@
public static OrderStatus Shipped = new OrderStatus(5, nameof(Shipped).ToLowerInvariant());
public static OrderStatus Cancelled = new OrderStatus(6, nameof(Cancelled).ToLowerInvariant());
protected OrderStatus()
{
}
public OrderStatus(int id, string name)
: base(id, name)
{


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

@ -7,12 +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; }
protected Enumeration()
{ }
public int Id { get; }
protected Enumeration(int id, string name)
{
@ -36,8 +33,8 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork
if (otherValue == null)
return false;
var typeMatches = GetType().Equals(obj.GetType());
var valueMatches = Id.Equals(otherValue.Id);
var typeMatches = GetType() == obj.GetType();
var valueMatches = Id == otherValue.Id;
return typeMatches && valueMatches;
}


Loading…
Cancel
Save