A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

Class PromotionItemCollection

Implements operations for and represents the promotion item collection.

Inheritance
System.Object
PromotionItemCollection
Implements
System.Collections.Generic.ICollection<PromotionItem>
System.Collections.Generic.IEnumerable<PromotionItem>
System.Collections.IEnumerable
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: Mediachase.Commerce.Marketing.Objects
Assembly: Mediachase.Commerce.dll
Version: 12.17.2
Syntax
[Obsolete("Use promotion system in EPiServer.Commerce.Marketing instead. Will be removed in a future major release, but not earlier than August 2018.")]
public class PromotionItemCollection : ICollection<PromotionItem>, IEnumerable<PromotionItem>, IEnumerable

Constructors

PromotionItemCollection(MarketingHelper)

Initializes a new instance of the PromotionItemCollection class.

Declaration
public PromotionItemCollection(MarketingHelper helper)
Parameters
Type Name Description
MarketingHelper helper

The helper.

PromotionItemCollection(PromotionItemCollection, Int32[])

Initializes a new instance of the PromotionItemCollection class.

Declaration
public PromotionItemCollection(PromotionItemCollection source, int[] validRowIndexes)
Parameters
Type Name Description
PromotionItemCollection source

The source.

System.Int32[] validRowIndexes

The valid row indexes.

Properties

Count

Gets the number of elements contained in the System.Collections.Generic.ICollection<T>.

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

IsReadOnly

Gets a value indicating whether the System.Collections.Generic.ICollection<T> is read-only.

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

Item[Int32]

Gets the PromotionItem at the specified index.

Declaration
public PromotionItem this[int index] { get; }
Parameters
Type Name Description
System.Int32 index
Property Value
Type Description
PromotionItem

Methods

Clear()

Removes all items from the System.Collections.Generic.ICollection<T>.

Declaration
public void Clear()
Exceptions
Type Condition
System.NotSupportedException

The System.Collections.Generic.ICollection<T> is read-only.

Contains(PromotionItem)

Determines whether the System.Collections.Generic.ICollection<T> contains a specific value.

Declaration
public bool Contains(PromotionItem item)
Parameters
Type Name Description
PromotionItem item

The object to locate in the System.Collections.Generic.ICollection<T>.

Returns
Type Description
System.Boolean

true if item is found in the System.Collections.Generic.ICollection<T>; otherwise, false.

CopyTo(PromotionItem[], Int32)

Copies the elements of the System.Collections.Generic.ICollection<T> to an System.Array, starting at a particular System.Array index.

Declaration
public void CopyTo(PromotionItem[] array, int arrayIndex)
Parameters
Type Name Description
PromotionItem[] array

The one-dimensional System.Array that is the destination of the elements copied from System.Collections.Generic.ICollection<T>. The System.Array must have zero-based indexing.

System.Int32 arrayIndex

The zero-based index in array at which copying begins.

Exceptions
Type Condition
System.ArgumentOutOfRangeException

arrayIndex is less than 0.

System.ArgumentNullException

array is null.

System.ArgumentException

array is multidimensional.-or-arrayIndex is equal to or greater than the length of array.-or-The number of elements in the source System.Collections.Generic.ICollection<T> is greater than the available space from arrayIndex to the end of the destination array.-or-Type T cannot be cast automatically to the type of the destination array.

GetEnumerator()

Returns an enumerator that iterates through the collection.

Declaration
public IEnumerator<PromotionItem> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<PromotionItem>

A System.Collections.Generic.IEnumerator<T> that can be used to iterate through the collection.

Remove(PromotionItem)

Removes the first occurrence of a specific object from the System.Collections.Generic.ICollection<T>.

Declaration
public bool Remove(PromotionItem item)
Parameters
Type Name Description
PromotionItem item

The object to remove from the System.Collections.Generic.ICollection<T>.

Returns
Type Description
System.Boolean

true if item was successfully removed from the System.Collections.Generic.ICollection<T>; otherwise, false. This method also returns false if item is not found in the original System.Collections.Generic.ICollection<T>.

Exceptions
Type Condition
System.NotSupportedException

The System.Collections.Generic.ICollection<T> is read-only.

Explicit Interface Implementations

ICollection<PromotionItem>.Add(PromotionItem)

Adds an item to the System.Collections.Generic.ICollection<T>.

Declaration
void ICollection<PromotionItem>.Add(PromotionItem item)
Parameters
Type Name Description
PromotionItem item

The object to add to the System.Collections.Generic.ICollection<T>.

Exceptions
Type Condition
System.NotSupportedException

The System.Collections.Generic.ICollection<T> is read-only.

IEnumerable.GetEnumerator()

Returns an enumerator that iterates through a collection.

Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type Description
System.Collections.IEnumerator

An System.Collections.IEnumerator object that can be used to iterate through the collection.

Implements

System.Collections.Generic.ICollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable