Example #1
0
 public override bool Equals(object obj)
 {
     if (obj is Product product)
     {
         return(ProductId.Equals(product.ProductId));
     }
     return(false);
 }
 public override bool Equals(object obj)
 {
     return(obj is ProductOption option &&
            Id.Equals(option.Id) &&
            ProductId.Equals(option.ProductId) &&
            Name == option.Name &&
            Description == option.Description);
 }
Example #3
0
        public override bool Equals(object obj)
        {
            var item = obj as BasketItem;

            return(item != null &&
                   ProductId.Equals(item.ProductId) &&
                   Quantity == item.Quantity);
        }
 public override bool Equals(object obj)
 {
     return(obj is ProductOptionDto dto &&
            Id.Equals(dto.Id) &&
            ProductId.Equals(dto.ProductId) &&
            Name == dto.Name &&
            Description == dto.Description);
 }
        public static void SampleIntValueObject()
        {
            Console.WriteLine("---IntValueObject Sample---");
            var productId      = new ProductId(1);
            var otherProductId = productId;
            var categoryId     = new CategoryId(1);

            Console.WriteLine("var productId = new ProductId(1);");
            Console.WriteLine("var otherProductId = productId;");
            Console.WriteLine("var categoryId = new CategoryId(1);");
            Console.WriteLine();
            Console.WriteLine($"productId: {productId}");
            Console.WriteLine($"productId.Value: {productId.Value}");
            Console.WriteLine();
            Console.WriteLine($"productId == otherProductId: {productId == otherProductId}");
            Console.WriteLine($"productId.Equals(otherProductId): {productId.Equals(otherProductId)}");
            Console.WriteLine($"productId == new ProductId(1): {productId == new ProductId(1)}");
            Console.WriteLine($"productId.Equals(new ProductId(1)): {productId.Equals(new ProductId(1))}");
            Console.WriteLine();
            Console.WriteLine($"productId == new ProductId(2): {productId == new ProductId(2)}");
            Console.WriteLine($"productId.Equals(new ProductId(2)): {productId.Equals(new ProductId(2))}");
            Console.WriteLine($"productId.Equals(null): {productId.Equals(null)}");
            Console.WriteLine($"productId.Equals(1): {productId.Equals(1)}");
            Console.WriteLine();
            Console.WriteLine("productId == categoryId: Compile Error");
            Console.WriteLine($"productId.Equals(categoryId): {productId.Equals(categoryId)}");
            Console.WriteLine("productId == new CategoryId(1):  Compile Error");
            Console.WriteLine($"productId.Equals(new CategoryId(1)): {productId.Equals(new CategoryId(1))}");
            Console.WriteLine();
        }
Example #6
0
        public override bool Equals(object obj)
        {
            var model = obj as BasketItemModel;

            return(model != null &&
                   SessionId.Equals(model.SessionId) &&
                   ProductId.Equals(model.ProductId) &&
                   Quantity == model.Quantity);
        }
Example #7
0
 public override bool Equals(object obj)
 {
     if (obj != null && obj is Product)
     {
         if (ProductId.Equals((obj as Product).ProductId))
         {
             return(true);
         }
     }
     return(false);
 }
Example #8
0
 public override bool Equals(System.Object otherReview)
 {
     if (!(otherReview is Review))
     {
         return(false);
     }
     else
     {
         return(ProductId.Equals(((Review)otherReview).ProductId));
     }
 }
Example #9
0
        public bool Equals(Sprint other)
        {
            if (ReferenceEquals(this, other))
            {
                return(true);
            }
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            return(TenantId.Equals(other.TenantId) &&
                   ProductId.Equals(other.ProductId) &&
                   SprintId.Equals(other.SprintId));
        }
Example #10
0
        /// <summary>
        /// Returns true if ProductReview instances are equal
        /// </summary>
        /// <param name="other">Instance of ProductReview to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ProductReview other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     ProductReviewID == other.ProductReviewID ||
                     ProductReviewID != null &&
                     ProductReviewID.Equals(other.ProductReviewID)
                     ) &&
                 (
                     ProductId == other.ProductId ||
                     ProductId != null &&
                     ProductId.Equals(other.ProductId)
                 ) &&
                 (
                     ReviewerName == other.ReviewerName ||
                     ReviewerName != null &&
                     ReviewerName.Equals(other.ReviewerName)
                 ) &&
                 (
                     ReviewDate == other.ReviewDate ||
                     ReviewDate != null &&
                     ReviewDate.Equals(other.ReviewDate)
                 ) &&
                 (
                     EmailAddress == other.EmailAddress ||
                     EmailAddress != null &&
                     EmailAddress.Equals(other.EmailAddress)
                 ) &&
                 (
                     Rating == other.Rating ||
                     Rating != null &&
                     Rating.Equals(other.Rating)
                 ) &&
                 (
                     Comments == other.Comments ||
                     Comments != null &&
                     Comments.Equals(other.Comments)
                 ));
        }
 public bool Equals(OrderItem other)
 {
     if (!OrderId.Equals(other.OrderId))
     {
         return(false);
     }
     if (!ProductId.Equals(other.ProductId))
     {
         return(false);
     }
     if (!Count.Equals(other.Count))
     {
         return(false);
     }
     return(true);
 }
        public override bool Equals(object obj)
        {
            if (obj is MarketFeedSettings == false)
            {
                return(false);
            }

            if (ProductId.Equals(((MarketFeedSettings)obj).ProductId) == false)
            {
                return(false);
            }
            if (Granularity.Equals(((MarketFeedSettings)obj).Granularity) == false)
            {
                return(false);
            }
            return(true);
        }
Example #13
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            ProductEN t = obj as ProductEN;

            if (t == null)
            {
                return(false);
            }
            if (ProductId.Equals(t.ProductId))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #14
0
        /// <summary>
        /// Returns true if BankingProduct instances are equal
        /// </summary>
        /// <param name="other">Instance of BankingProduct to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BankingProduct other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     ProductId == other.ProductId ||
                     ProductId != null &&
                     ProductId.Equals(other.ProductId)
                     ) &&
                 (
                     EffectiveFrom == other.EffectiveFrom ||
                     EffectiveFrom != null &&
                     EffectiveFrom.Equals(other.EffectiveFrom)
                 ) &&
                 (
                     EffectiveTo == other.EffectiveTo ||
                     EffectiveTo != null &&
                     EffectiveTo.Equals(other.EffectiveTo)
                 ) &&
                 (
                     LastUpdated == other.LastUpdated ||
                     LastUpdated != null &&
                     LastUpdated.Equals(other.LastUpdated)
                 ) &&
                 (
                     ProductCategory == other.ProductCategory ||
                     ProductCategory != null &&
                     ProductCategory.Equals(other.ProductCategory)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     Brand == other.Brand ||
                     Brand != null &&
                     Brand.Equals(other.Brand)
                 ) &&
                 (
                     BrandName == other.BrandName ||
                     BrandName != null &&
                     BrandName.Equals(other.BrandName)
                 ) &&
                 (
                     ApplicationUri == other.ApplicationUri ||
                     ApplicationUri != null &&
                     ApplicationUri.Equals(other.ApplicationUri)
                 ) &&
                 (
                     IsTailored == other.IsTailored ||
                     IsTailored != null &&
                     IsTailored.Equals(other.IsTailored)
                 ) &&
                 (
                     AdditionalInformation == other.AdditionalInformation ||
                     AdditionalInformation != null &&
                     AdditionalInformation.Equals(other.AdditionalInformation)
                 ));
        }
 public override bool Equals(object obj)
 {
     return(ProductId.Equals(((ProductFields)obj).ProductId) && FieldId.Equals(((ProductFields)obj).FieldId));
 }
Example #16
0
 protected bool Equals(ProductOption other)
 {
     return(Id.Equals(other.Id) && ProductId.Equals(other.ProductId) && string.Equals(Name, other.Name) &&
            string.Equals(Description, other.Description));
 }
Example #17
0
 public override bool Equals(object obj)
 {
     return(ProductId.Equals(((Product)obj).ProductId));
 }
Example #18
0
        /// <summary>
        /// Returns true if Product instances are equal
        /// </summary>
        /// <param name="other">Instance of Product to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Product other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     ProductId == other.ProductId ||
                     ProductId != null &&
                     ProductId.Equals(other.ProductId)
                     ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     ProductNumber == other.ProductNumber ||
                     ProductNumber != null &&
                     ProductNumber.Equals(other.ProductNumber)
                 ) &&
                 (
                     Color == other.Color ||
                     Color != null &&
                     Color.Equals(other.Color)
                 ) &&
                 (
                     StandardCost == other.StandardCost ||
                     StandardCost != null &&
                     StandardCost.Equals(other.StandardCost)
                 ) &&
                 (
                     ListPrice == other.ListPrice ||
                     ListPrice != null &&
                     ListPrice.Equals(other.ListPrice)
                 ) &&
                 (
                     Size == other.Size ||
                     Size != null &&
                     Size.Equals(other.Size)
                 ) &&
                 (
                     Weight == other.Weight ||
                     Weight != null &&
                     Weight.Equals(other.Weight)
                 ) &&
                 (
                     ProductLine == other.ProductLine ||
                     ProductLine != null &&
                     ProductLine.Equals(other.ProductLine)
                 ) &&
                 (
                     Class == other.Class ||
                     Class != null &&
                     Class.Equals(other.Class)
                 ) &&
                 (
                     Style == other.Style ||
                     Style != null &&
                     Style.Equals(other.Style)
                 ) &&
                 (
                     SubCategory == other.SubCategory ||
                     SubCategory != null &&
                     SubCategory.Equals(other.SubCategory)
                 ) &&
                 (
                     Model == other.Model ||
                     Model != null &&
                     Model.Equals(other.Model)
                 ) &&
                 (
                     Photo == other.Photo ||
                     Photo != null &&
                     Photo.Equals(other.Photo)
                 ) &&
                 (
                     Review == other.Review ||
                     Review != null &&
                     Review.SequenceEqual(other.Review)
                 ));
        }
Example #19
0
 protected virtual void SetLink()
 {
     Link = ProductId.Equals(CurrentStorefront.GiftCardProductId, StringComparison.OrdinalIgnoreCase) ? CurrentStorefront.GiftCardPageLink : LinkManager.GetItemUrl(CatalogItem);
 }
Example #20
0
 private bool Equals(OrderJson other)
 {
     return(Id == other.Id && Quantity == other.Quantity && ProductId.Equals(other.ProductId));
 }