Skip to content

Commit

Permalink
fix: Make the multiplication of Money by Money obsolete, as it makes …
Browse files Browse the repository at this point in the history
…no sense
  • Loading branch information
artem-dudarev committed Nov 15, 2024
1 parent b0dd10c commit 41b932b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/VirtoCommerce.CoreModule.Core/Currency/Money.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 41b932b

Please sign in to comment.