From 41b932be255259bf7514439801c0f70738ed5e71 Mon Sep 17 00:00:00 2001 From: Artem Dudarev Date: Fri, 15 Nov 2024 15:22:23 +0200 Subject: [PATCH] fix: Make the multiplication of Money by Money obsolete, as it makes no sense --- src/VirtoCommerce.CoreModule.Core/Currency/Money.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/VirtoCommerce.CoreModule.Core/Currency/Money.cs b/src/VirtoCommerce.CoreModule.Core/Currency/Money.cs index edea9302..4d779988 100644 --- a/src/VirtoCommerce.CoreModule.Core/Currency/Money.cs +++ b/src/VirtoCommerce.CoreModule.Core/Currency/Money.cs @@ -115,6 +115,7 @@ public decimal TruncatedAmount public static Money operator -(Money first, Money second) => new Money(first.InternalAmount - second.ConvertTo(first.Currency).InternalAmount, first.Currency); + [Obsolete("Multiplying Money by Money makes no sense", DiagnosticId = "VC0009", UrlFormat = "https://docs.virtocommerce.org/products/products-virto3-versions/")] public static Money operator *(Money first, Money second) => new Money(first.InternalAmount * second.ConvertTo(first.Currency).InternalAmount, first.Currency);