November Happy Hour will be moved to Thursday December 5th.

Class Association

Describes an association of a catalog entry eg an accessory, up-sell or cross-sell product etc.

Inheritance
System.Object
Association
Implements
EPiServer.Data.Entity.IReadOnly<Association>
EPiServer.Data.Entity.IReadOnly
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.Catalog.Linking
Assembly: EPiServer.Business.Commerce.dll
Version: 12.17.2
Syntax
public class Association : IReadOnly<Association>, IReadOnly

Constructors

Association()

Declaration
public Association()

Properties

Group

Gets or sets the association group.

Declaration
public AssociationGroup Group { get; set; }
Property Value
Type Description
AssociationGroup

IsReadOnly

Indicates whether the current object instance is read-only.

Declaration
public bool IsReadOnly { get; }
Property Value
Type Description
System.Boolean

SortOrder

The sort order of the association

Declaration
public int SortOrder { get; set; }
Property Value
Type Description
System.Int32

Source

Gets or sets the source of the association (the item that has the association, e.g. a catalog entry for which we want to recommend accessories).

Declaration
public ContentReference Source { get; set; }
Property Value
Type Description
EPiServer.Core.ContentReference

Target

Gets or sets the target of the association (the item we're associating to, e.g. an accessory to the Source product).

Declaration
public ContentReference Target { get; set; }
Property Value
Type Description
EPiServer.Core.ContentReference

Type

Gets or sets the type of the association.

Declaration
public AssociationType Type { get; set; }
Property Value
Type Description
AssociationType

Methods

CreateWritableClone()

Creates a writable copy of the current object.

Declaration
public Association CreateWritableClone()
Returns
Type Description
Association

A writable copy of the current object.

Remarks

The cloning is a deep-copy.

MakeReadOnly()

Changes the object instance into a read-only object.

Declaration
public void MakeReadOnly()
Remarks

After calling this method, any attempt to change the object instance or any contained object will generate a System.NotSupportedException. I.e. the semantics is "deep read-only".

Note! After setting an object to read-only it is not possible to revert back to read-write mode. You will have to call the CreateWritableClone method to get a copy that can be modified.

ThrowIfReadOnly()

Calls EPiServer.Data.Validator.ValidateNotReadOnly(EPiServer.Data.Entity.IReadOnly) which throws an exception if the item is in read-only mode. Subtypes should call this before accepting any modification to the object.

Declaration
protected void ThrowIfReadOnly()

Implements

EPiServer.Data.Entity.IReadOnly<>
EPiServer.Data.Entity.IReadOnly