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
SortDirection- Current sort direction of the collection.
DiscountCollection(IDataReader)
Initializes a new instance of an OrderDiscountCollection from DataReader
[Obsolete("This method is no longer used.")]
public DiscountCollection(IDataReader dataReader)
Parameters
dataReader
IDataReader- IDataReader
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
Load(string)
[Obsolete("This method is no longer used.")]
public void Load(string query)
Parameters
query
string
Sort()
public void Sort()
Sort(SortBy)
Sorts elements according to the given field.
public void Sort(SortBy sortByEnum)
Parameters
sortByEnum
SortBy- Field for sorting.
Sort(SortBy, SortDirection)
Sorts elements according to the given field and direction.
public void Sort(SortBy sortByEnum, SortDirection sortDirection)
Parameters
sortByEnum
SortBy- Field for sorting.
sortDirection
SortDirection- Direction 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.