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 Shipped = new OrderStatus(5, nameof(Shipped).ToLowerInvariant());
|
||||||
public static OrderStatus Cancelled = new OrderStatus(6, nameof(Cancelled).ToLowerInvariant());
|
public static OrderStatus Cancelled = new OrderStatus(6, nameof(Cancelled).ToLowerInvariant());
|
||||||
|
|
||||||
protected OrderStatus()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public OrderStatus(int id, string name)
|
public OrderStatus(int id, string name)
|
||||||
: base(id, name)
|
: base(id, name)
|
||||||
{
|
{
|
||||||
|
@ -7,12 +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(int id, string name)
|
protected Enumeration(int id, string name)
|
||||||
{
|
{
|
||||||
@ -36,8 +33,8 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork
|
|||||||
if (otherValue == null)
|
if (otherValue == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var typeMatches = GetType().Equals(obj.GetType());
|
var typeMatches = GetType() == obj.GetType();
|
||||||
var valueMatches = Id.Equals(otherValue.Id);
|
var valueMatches = Id == otherValue.Id;
|
||||||
|
|
||||||
return typeMatches && valueMatches;
|
return typeMatches && valueMatches;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user