Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Class MoneyExtensions

Extension methods for the Money class.

Inheritance
System.Object
MoneyExtensions
Namespace: EPiServer.Commerce.Marketing.Internal
Assembly: EPiServer.Business.Commerce.dll
Version: 14.26.0
Syntax
public static class MoneyExtensions : Object

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.