laatzen/LaaProductionWeb/LaaProduction.Services/Models/OrderInfoModel.cs
2024-07-17 13:13:41 +02:00

33 lines
918 B
C#

namespace LaaProduction.Services.Models
{
using System;
using System.Collections.Generic;
public class OrderInfoModel
{
public Int32 OrderNr { get; set; }
public Int32 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 Boolean Equals(OrderInfoModel x, OrderInfoModel y)
=> x?.OrderNr == y?.OrderNr;
public Int32 GetHashCode(OrderInfoModel obj)
=> obj?.OrderNr ?? default(Int32);
}
}
}