Try our conversational search powered by Generative AI!

Class MoneyExtensions

Extension methods for the Money class.

Inheritance
System.Object
MoneyExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Commerce.Marketing.Internal
Assembly: EPiServer.Business.Commerce.dll
Version: 12.17.2
Syntax
public static class MoneyExtensions

Methods

ThrowIfNegative(Money, String)

Validates that the Money does not have a negative amount.

Declaration
public static void ThrowIfNegative(this Money money, string validationErrorMessage)
Parameters
Type Name Description
Money money

The money to validate.

System.String validationErrorMessage

The validation error message, that will be used when throwing an exception if the validation fails.

Exceptions
Type Condition
System.ComponentModel.DataAnnotations.ValidationException

If the validation fails.