using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; namespace BBWY.Client.Models { /// /// 采购商 /// public class Purchaser : NotifyObject { private int skuUseCount; public string Id { get; set; } public string Name { get; set; } /// /// 使用该采购商的SKU数量 /// public int SkuUseCount { get => skuUseCount; set { Set(ref skuUseCount, value); } } public string ProductId { get; set; } public string Location { get; set; } public Platform Platform { get; set; } public decimal DefaultCost { get; set; } public DateTime? LastPurchaseTime { get; set; } } public class PurchaserComparer : IEqualityComparer { public bool Equals([AllowNull] Purchaser x, [AllowNull] Purchaser y) { if (Object.ReferenceEquals(x, y)) return true; if (Object.ReferenceEquals(x, null) || Object.ReferenceEquals(y, null)) return false; return x?.Id == y?.Id; } public int GetHashCode([DisallowNull] Purchaser obj) { return base.GetHashCode(); } } }