laatzen/LaaProductionWeb/LaaProduction.Services/Models/OrderInfoModel.cs
2023-06-19 15:43:55 +02:00

32 lines
889 B
C#

namespace LaaProduction.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);
}
}
}