コード例 #1
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is CatalogItem other &&
                   ((Name == null && other.Name == null) || (Name?.Equals(other.Name) == true)) &&
                   ((Description == null && other.Description == null) || (Description?.Equals(other.Description) == true)) &&
                   ((Abbreviation == null && other.Abbreviation == null) || (Abbreviation?.Equals(other.Abbreviation) == true)) &&
                   ((LabelColor == null && other.LabelColor == null) || (LabelColor?.Equals(other.LabelColor) == true)) &&
                   ((AvailableOnline == null && other.AvailableOnline == null) || (AvailableOnline?.Equals(other.AvailableOnline) == true)) &&
                   ((AvailableForPickup == null && other.AvailableForPickup == null) || (AvailableForPickup?.Equals(other.AvailableForPickup) == true)) &&
                   ((AvailableElectronically == null && other.AvailableElectronically == null) || (AvailableElectronically?.Equals(other.AvailableElectronically) == true)) &&
                   ((CategoryId == null && other.CategoryId == null) || (CategoryId?.Equals(other.CategoryId) == true)) &&
                   ((TaxIds == null && other.TaxIds == null) || (TaxIds?.Equals(other.TaxIds) == true)) &&
                   ((ModifierListInfo == null && other.ModifierListInfo == null) || (ModifierListInfo?.Equals(other.ModifierListInfo) == true)) &&
                   ((Variations == null && other.Variations == null) || (Variations?.Equals(other.Variations) == true)) &&
                   ((ProductType == null && other.ProductType == null) || (ProductType?.Equals(other.ProductType) == true)) &&
                   ((SkipModifierScreen == null && other.SkipModifierScreen == null) || (SkipModifierScreen?.Equals(other.SkipModifierScreen) == true)) &&
                   ((ItemOptions == null && other.ItemOptions == null) || (ItemOptions?.Equals(other.ItemOptions) == true)));
        }