Update Enumeration
This commit is contained in:
parent
53479908a0
commit
488c607a7e
@ -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)
|
||||
{
|
||||
|
@ -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…
x
Reference in New Issue
Block a user