Class DiscountCollection
- Namespace
- Dynamicweb.Ecommerce.Orders.Discounts
- Assembly
- Dynamicweb.Ecommerce.dll
Represents information about a discount collection.
public class DiscountCollection : Collection<Discount>, IList<Discount>, ICollection<Discount>, IReadOnlyList<Discount>, IReadOnlyCollection<Discount>, IEnumerable<Discount>, IList, ICollection, IEnumerable
- Inheritance
-
DiscountCollection
- Implements
- Inherited Members
- Extension Methods
Constructors
DiscountCollection()
constructor
public DiscountCollection()
DiscountCollection(IEnumerable<Discount>)
Initializes a new instance of an OrderDiscountCollection with the provided discounts
public DiscountCollection(IEnumerable<Discount> discounts)
Parameters
discounts
IEnumerable<Discount>OrderDiscount to be added to the list
DiscountCollection(IEnumerable<Discount>, SortBy, SortDirection)
Initializes a new instance of an OrderDiscountCollection with the provided discounts
public DiscountCollection(IEnumerable<Discount> discounts, SortBy currentSort, SortDirection currentSortDirection)
Parameters
discounts
IEnumerable<Discount>OrderDiscount to be added to the list
currentSort
SortByСurrent sort type in the collection. Used if collection already sorted by some criteria.
currentSortDirection
SortDirectionCurrent sort direction of the collection.
Properties
Data
Gets the underlying data storage.
protected List<Discount> Data { get; }
Property Value
Methods
GetRange(int, int)
Creates a shallow copy of a range of elements in the source OrderDiscountCollection.
public List<Discount> GetRange(int index, int count)
Parameters
Returns
Sort()
public void Sort()
Sort(SortBy)
Sorts elements according to the given field.
public void Sort(SortBy sortByEnum)
Parameters
sortByEnum
SortByField for sorting.
Sort(SortBy, SortDirection)
Sorts elements according to the given field and direction.
public void Sort(SortBy sortByEnum, SortDirection sortDirection)
Parameters
sortByEnum
SortByField for sorting.
sortDirection
SortDirectionDirection of sorting, ACS or DESC.
Sort(IComparer<Discount>)
Sorts elements according to the given comparer.
public void Sort(IComparer<Discount> comparer)
Parameters
Sort(Comparison<Discount>)
Sorts elements according to the given comparison.
public void Sort(Comparison<Discount> comparison)
Parameters
comparison
Comparison<Discount>Comparison.