laatzen/LaaProductionWeb/LaaProductionWeb.Services/Models/OrderInfoModel.cs
2023-05-11 09:31:14 +02:00

32 lines
892 B
C#

namespace LaaProductionWeb.Services.Models
{
using System.Collections.Generic;
public class OrderInfoModel
{
public int OrderNr { get; set; }
public int ProductionOrderNr { get; set; }
public string Customer { 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);
}
}
}