Class DefaultLineItemValidator
Validates a ILineItem to make sure the line item is still valid to be purchased.
Inheritance
Implements
Namespace: EPiServer.Commerce.Order
Assembly: EPiServer.Business.Commerce.dll
Version: 14.26.0Syntax
public class DefaultLineItemValidator : Object, ILineItemValidator
Constructors
DefaultLineItemValidator(IContentLoader, ReferenceConverter, ICatalogSystem, IPublishedStateAssessor)
Initializes a new instance of the DefaultLineItemValidator class.
Declaration
public DefaultLineItemValidator(IContentLoader contentLoader, ReferenceConverter referenceConverter, ICatalogSystem catalogSystem, IPublishedStateAssessor publishedStateAssessor)
Parameters
| Type | Name | Description |
|---|---|---|
| EPiServer.IContentLoader | contentLoader | The content loader. |
| ReferenceConverter | referenceConverter | The reference converter. |
| ICatalogSystem | catalogSystem | The catalog system. |
| EPiServer.Core.IPublishedStateAssessor | publishedStateAssessor | The published state assessor. |
Methods
IsValidCatalog(EntryContentBase, DateTime)
Determines whether is valid catalog for the specified entry.
Declaration
protected virtual bool IsValidCatalog(EntryContentBase entry, DateTime requestDate)
Parameters
| Type | Name | Description |
|---|---|---|
| EntryContentBase | entry | The entry. |
| System.DateTime | requestDate | The request date. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the catalog is valid. |
IsValidEntry(EntryContentBase)
Determines whether is valid entry for the specified entry.
Declaration
protected virtual bool IsValidEntry(EntryContentBase entry)
Parameters
| Type | Name | Description |
|---|---|---|
| EntryContentBase | entry | The entry. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
IsValidMarket(EntryContentBase, MarketId)
Determines whether is valid market for the specified content.
Declaration
protected virtual bool IsValidMarket(EntryContentBase content, MarketId marketId)
Parameters
| Type | Name | Description |
|---|---|---|
| EntryContentBase | content | The content. |
| MarketId | marketId | The market id. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if market is valid. |
Validate(ILineItem, MarketId, Action<ILineItem, ValidationIssue>)
Validates the specified line item.
Declaration
public virtual bool Validate(ILineItem lineItem, MarketId marketId, Action<ILineItem, ValidationIssue> onValidationError)
Parameters
| Type | Name | Description |
|---|---|---|
| ILineItem | lineItem | The line item. |
| MarketId | marketId | The market id. |
| System.Action<ILineItem, ValidationIssue> | onValidationError | A callback that is invoked if a validation issue is detected. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|