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