Existing code
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
namespace LaaProductionWeb.Services.Models
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class OrderInfoModel
|
||||
{
|
||||
public int OrderNr { get; set; }
|
||||
|
||||
public int ProductionOrderNr { get; set; }
|
||||
|
||||
public string ClientName { get; set; }
|
||||
|
||||
public string Nr
|
||||
=> this.OrderNr > 0
|
||||
? $"{this.OrderNr}"
|
||||
: this.ProductionOrderNr > 0
|
||||
? $"{this.ProductionOrderNr}"
|
||||
: default(string);
|
||||
|
||||
public static readonly OrderInfoComparer Comparer
|
||||
= new OrderInfoComparer();
|
||||
|
||||
public class OrderInfoComparer : IEqualityComparer<OrderInfoModel>
|
||||
{
|
||||
public bool Equals(OrderInfoModel x, OrderInfoModel y)
|
||||
=> x?.OrderNr == y?.OrderNr;
|
||||
|
||||
public int GetHashCode(OrderInfoModel obj)
|
||||
=> obj?.OrderNr ?? default(int);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user