Try our conversational search powered by Generative AI!

Class DefaultLineItemValidator

Validates a ILineItem to make sure the line item is still valid to be purchased.

Inheritance
System.Object
DefaultLineItemValidator
Implements
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.Order
Assembly: EPiServer.Business.Commerce.dll
Version: 12.17.2
Syntax
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

True if the entry is valid, otherwise False.

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

True if the entry is valid, False.

IsValidMarket(EntryContentBase, IMarket)

Determines whether is valid market for the specified content.

Declaration
[Obsolete("This method is no longer used. Use the overload with MarketId instead. Will remain at least until May 2019.")]
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.

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, IMarket, Action<ILineItem, ValidationIssue>)

Declaration
[Obsolete("This method is no longer used. Use the overload with MarketId instead. Will remain at least until May 2019.")]
public virtual bool Validate(ILineItem lineItem, IMarket market, Action<ILineItem, ValidationIssue> onValidationError)
Parameters
Type Name Description
ILineItem lineItem
IMarket market
System.Action<ILineItem, ValidationIssue> onValidationError
Returns
Type Description
System.Boolean

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

True if it passes all validations without error, False.

Implements