Show / Hide Table of Contents

Class IEnumerableExtensions

Inheritance
System.Object
IEnumerableExtensions
Namespace: NineDigit.eKasa
Assembly: NineDigit.eKasa.dll
Syntax
public static class IEnumerableExtensions : Object

Methods

ContainsVoucherApplicationResultingToZeroAmount(IEnumerable<ReceiptItem>)

Declaration
public static bool ContainsVoucherApplicationResultingToZeroAmount(this IEnumerable<ReceiptItem> items)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<ReceiptItem> items
Returns
Type Description
System.Boolean

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
System.Collections.Generic.IEnumerable<TSource> source

Source sequence

System.Func<TSource, TKey> keySelector

Projection for determining "distinctness"

Returns
Type Description
System.Collections.Generic.IEnumerable<TSource>

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
System.Collections.Generic.IEnumerable<TSource> source

Source sequence

System.Func<TSource, TKey> keySelector

Projection for determining "distinctness"

System.Collections.Generic.IEqualityComparer<TKey> 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
System.Collections.Generic.IEnumerable<TSource>

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
System.Collections.Generic.IEnumerable<IRegisterToken> self

Zoznam IRegisterToken.

RegisterTokenQuery query

Dopyt.

Returns
Type Description
QueryResult<IRegisterToken>

Vyfiltrovaný zoznam.

Exceptions
Type Condition
System.ArgumentNullException

self je null.

System.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
System.Collections.Generic.IEnumerable<TRecord> source
DateTimeOffsetRange dateTimeRange
Returns
Type Description
System.Collections.Generic.IEnumerable<TRecord>
Type Parameters
Name Description
TRecord

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

Declaration
public static IEnumerable<T> ForEach<T>(this IEnumerable<T> self, Action<T, int> handler)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<T> self
System.Action<T, System.Int32> handler
Returns
Type Description
System.Collections.Generic.IEnumerable<T>
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
System.Collections.Generic.IEnumerable<T> self
System.Action<T> handler
Returns
Type Description
System.Collections.Generic.IEnumerable<T>
Type Parameters
Name Description
T

GetTotalAmount(IEnumerable<ReceiptItem>)

Declaration
public static Amount GetTotalAmount(this IEnumerable<ReceiptItem> self)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<ReceiptItem> self
Returns
Type Description
Amount

GetTotalAmount(IEnumerable<ReceiptPayment>)

Declaration
public static Amount GetTotalAmount(this IEnumerable<ReceiptPayment> self)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<ReceiptPayment> self
Returns
Type Description
Amount

IsNullOrEmpty<T>(IEnumerable<T>)

Declaration
public static bool IsNullOrEmpty<T>(this IEnumerable<T> self)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<T> self
Returns
Type Description
System.Boolean
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
System.Collections.Generic.IEnumerable<System.String> self

Zoznam reťazcov

System.String separator

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

Returns
Type Description
System.String

Výsledný reťazec

Exceptions
Type Condition
System.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
System.Collections.Generic.IEnumerable<T> self
Pagination pagination
Returns
Type Description
System.Collections.Generic.IEnumerable<T>
Type Parameters
Name Description
T

ToReadOnlyCollection<TSource>(IEnumerable<TSource>)

Declaration
public static ReadOnlyCollection<TSource> ToReadOnlyCollection<TSource>(this IEnumerable<TSource> source)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<TSource> source
Returns
Type Description
System.Collections.ObjectModel.ReadOnlyCollection<TSource>
Type Parameters
Name Description
TSource

ToReadOnlyCollection<TSource>(IList<TSource>)

Declaration
public static ReadOnlyCollection<TSource> ToReadOnlyCollection<TSource>(this IList<TSource> source)
Parameters
Type Name Description
System.Collections.Generic.IList<TSource> source
Returns
Type Description
System.Collections.ObjectModel.ReadOnlyCollection<TSource>
Type Parameters
Name Description
TSource

ToVatRatesTaxSummary(IEnumerable<ReceiptItem>)

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