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 { public Boolean Equals(OrderInfoModel x, OrderInfoModel y) => x?.OrderNr == y?.OrderNr; public Int32 GetHashCode(OrderInfoModel obj) => obj?.OrderNr ?? default(Int32); } } }