Class DefaultLineItemValidator
Validates a ILineItem to make sure the line item is still valid to be purchased.
Inheritance
Implements
Inherited Members
Namespace: EPiServer.Commerce.Order
Assembly: EPiServer.Business.Commerce.dll
Version: 10.8.0Syntax
public class DefaultLineItemValidator : ILineItemValidator
Constructors
DefaultLineItemValidator(IContentLoader, ReferenceConverter, ICatalogSystem)
Initializes a new instance of the DefaultLineItemValidator class.
Declaration
[Obsolete("This constructor is no longer used. Use the overload with IPublishedStateAssessor parameter instead. Will remain at least until August 2018.")]
public DefaultLineItemValidator(IContentLoader contentLoader, ReferenceConverter referenceConverter, ICatalogSystem catalogSystem)
Parameters
Type | Name | Description |
---|---|---|
EPiServer.IContentLoader | contentLoader | The content loader. |
ReferenceConverter | referenceConverter | The reference converter. |
ICatalogSystem | catalogSystem | The catalog system. |
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 |
|
IsValidEntry(EntryContentBase, DateTime)
Determines whether is valid entry for the specified entry.
Declaration
[Obsolete("This method is no longer used. Use the overload without requestDate parameter instead. Will remain at least until August 2018.")]
protected virtual bool IsValidEntry(EntryContentBase entry, DateTime requestDate)
Parameters
Type | Name | Description |
---|---|---|
EntryContentBase | entry | The entry. |
System.DateTime | requestDate | The request date. |
Returns
Type | Description |
---|---|
System.Boolean |
|
IsValidMarket(EntryContentBase, IMarket)
Determines whether is valid market for the specified content.
Declaration
protected virtual bool IsValidMarket(EntryContentBase content, IMarket market)
Parameters
Type | Name | Description |
---|---|---|
EntryContentBase | content | The content. |
IMarket | market | The market. |
Returns
Type | Description |
---|---|
System.Boolean | True if market is valid. |
Validate(ILineItem, IMarket, Action<ILineItem, ValidationIssue>)
Validates the specified line item.
Declaration
public virtual bool Validate(ILineItem lineItem, IMarket market, Action<ILineItem, ValidationIssue> onValidationError)
Parameters
Type | Name | Description |
---|---|---|
ILineItem | lineItem | The line item. |
IMarket | market | The market. |
System.Action<ILineItem, ValidationIssue> | onValidationError | A callback that is invoked if a validation issue is detected. |
Returns
Type | Description |
---|---|
System.Boolean |
|