Show / Hide Table of Contents

Class IEnumerableExtensions

Inheritance
object
IEnumerableExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: NineDigiteKasa
Assembly: NineDigit.eKasa.dll
Syntax
public static class IEnumerableExtensions

Methods

ContainsVoucherApplicationResultingToZeroAmount(IEnumerable<ReceiptItem>)

Declaration
public static bool ContainsVoucherApplicationResultingToZeroAmount(this IEnumerable<ReceiptItem> items)
Parameters
Type Name Description
IEnumerableReceiptItem items
Returns
Type Description
bool

DistinctBy<TSource, TKey>(IEnumerable<TSource>, Func<TSource, TKey>)

Returns all distinct elements of the given source, where "distinctness" is determined via a projection and the default equality comparer for the projected type.

Declaration
public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
Parameters
Type Name Description
IEnumerable source

Source sequence

Func keySelector

Projection for determining "distinctness"

Returns
Type Description
IEnumerable

A sequence consisting of distinct elements from the source sequence, comparing them by the specified key projection.

Type Parameters
Name Description
TSource

Type of the source sequence

TKey

Type of the projected element

Remarks

This operator uses deferred execution and streams the results, although a set of already-seen keys is retained. If a key is seen multiple times, only the first element with that key is returned.

DistinctBy<TSource, TKey>(IEnumerable<TSource>, Func<TSource, TKey>, IEqualityComparer<TKey>)

Returns all distinct elements of the given source, where "distinctness" is determined via a projection and the specified comparer for the projected type.

Declaration
public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer)
Parameters
Type Name Description
IEnumerable source

Source sequence

Func keySelector

Projection for determining "distinctness"

IEqualityComparer comparer

The equality comparer to use to determine whether or not keys are equal. If null, the default equality comparer for TSource is used.

Returns
Type Description
IEnumerable

A sequence consisting of distinct elements from the source sequence, comparing them by the specified key projection.

Type Parameters
Name Description
TSource

Type of the source sequence

TKey

Type of the projected element

Remarks

This operator uses deferred execution and streams the results, although a set of already-seen keys is retained. If a key is seen multiple times, only the first element with that key is returned.

Filter(IEnumerable<IRegisterToken>, RegisterTokenQuery)

Aplikuje filter nad zoznamom IRegisterToken.

Declaration
public static QueryResult<IRegisterToken> Filter(this IEnumerable<IRegisterToken> self, RegisterTokenQuery query)
Parameters
Type Name Description
IEnumerableIRegisterToken self

Zoznam IRegisterToken.

RegisterTokenQuery query

Dopyt.

Returns
Type Description
QueryResultIRegisterToken

Vyfiltrovaný zoznam.

Exceptions
Type Condition
ArgumentNullException

self je null.

ArgumentNullException

query je null.

Filter<TRecord>(IEnumerable<TRecord>, DateTimeOffsetRange)

Declaration
public static IEnumerable<TRecord> Filter<TRecord>(this IEnumerable<TRecord> source, DateTimeOffsetRange dateTimeRange) where TRecord : Record
Parameters
Type Name Description
IEnumerable source
DateTimeOffsetRange dateTimeRange
Returns
Type Description
IEnumerable
Type Parameters
Name Description
TRecord

ForEach<T>(IEnumerable<T>, Action<T, int>)

Declaration
public static IEnumerable<T> ForEach<T>(this IEnumerable<T> self, Action<T, int> handler)
Parameters
Type Name Description
IEnumerable self
Actionint handler
Returns
Type Description
IEnumerable
Type Parameters
Name Description
T

ForEach<T>(IEnumerable<T>, Action<T>)

Declaration
public static IEnumerable<T> ForEach<T>(this IEnumerable<T> self, Action<T> handler)
Parameters
Type Name Description
IEnumerable self
Action handler
Returns
Type Description
IEnumerable
Type Parameters
Name Description
T

GetTotalAmount(IEnumerable<ReceiptItem>)

Declaration
public static Amount GetTotalAmount(this IEnumerable<ReceiptItem> self)
Parameters
Type Name Description
IEnumerableReceiptItem self
Returns
Type Description
Amount

GetTotalAmount(IEnumerable<ReceiptPayment>)

Declaration
public static Amount GetTotalAmount(this IEnumerable<ReceiptPayment> self)
Parameters
Type Name Description
IEnumerableReceiptPayment self
Returns
Type Description
Amount

IsNullOrEmpty<T>(IEnumerable<T>)

Declaration
public static bool IsNullOrEmpty<T>(this IEnumerable<T> self)
Parameters
Type Name Description
IEnumerable self
Returns
Type Description
bool
Type Parameters
Name Description
T

Join(IEnumerable<string>, string)

Zreťazí pole reťazcov

Declaration
public static string Join(this IEnumerable<string> self, string separator)
Parameters
Type Name Description
IEnumerablestring self

Zoznam reťazcov

string separator

Separátor, oddeľujúci jednotlivé reťazce

Returns
Type Description
string

Výsledný reťazec

Exceptions
Type Condition
ArgumentNullException

Ak self je null.

Paginate<T>(IEnumerable<T>, Pagination)

Declaration
public static IEnumerable<T> Paginate<T>(this IEnumerable<T> self, Pagination pagination)
Parameters
Type Name Description
IEnumerable self
Pagination pagination
Returns
Type Description
IEnumerable
Type Parameters
Name Description
T

ToReadOnlyCollection<TSource>(IEnumerable<TSource>)

Declaration
public static ReadOnlyCollection<TSource> ToReadOnlyCollection<TSource>(this IEnumerable<TSource> source)
Parameters
Type Name Description
IEnumerable source
Returns
Type Description
ReadOnlyCollection
Type Parameters
Name Description
TSource

ToReadOnlyCollection<TSource>(IList<TSource>)

Declaration
public static ReadOnlyCollection<TSource> ToReadOnlyCollection<TSource>(this IList<TSource> source)
Parameters
Type Name Description
IList source
Returns
Type Description
ReadOnlyCollection
Type Parameters
Name Description
TSource

ToVatRatesTaxSummary(IEnumerable<ReceiptItem>)

Declaration
public static VatRatesTaxSummary ToVatRatesTaxSummary(this IEnumerable<ReceiptItem> items)
Parameters
Type Name Description
IEnumerableReceiptItem items
Returns
Type Description
VatRatesTaxSummary
In This Article
Na začiatok stránky Nine Digit, s.r.o. ©