confluent-kafka-dotnet
Show / Hide Table of Contents

Class Utils

Inheritance
object
Utils
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Confluent.SchemaRegistry
Assembly: Confluent.SchemaRegistry.dll
Syntax
public static class Utils

Methods

IEnumerableHashCode<T>(IEnumerable<T>)

Declaration
public static int IEnumerableHashCode<T>(IEnumerable<T> items)
Parameters
Type Name Description
IEnumerable<T> items
Returns
Type Description
int
Type Parameters
Name Description
T

ListEquals<T>(IList<T>, IList<T>)

Declaration
public static bool ListEquals<T>(IList<T> a, IList<T> b)
Parameters
Type Name Description
IList<T> a
IList<T> b
Returns
Type Description
bool
Type Parameters
Name Description
T

TransformDictionaryAsync(object, Func<object, object, Task<object>>)

Asynchronously transforms each value of an IDictionary<K,V>, by invoking the provided Func<object, object, Task<object>> passing in the key and the original value and returns a new Dictionary<K,V> whose values are the awaited results.

Declaration
public static Task<object> TransformDictionaryAsync(object sourceDictionary, Func<object, object, Task<object>> transformer)
Parameters
Type Name Description
object sourceDictionary

An object implementing IDictionary<K,V> for some K,V.

Func<object, object, Task<object>> transformer

A function that takes (key as object, value as object) and returns a Task whose Result is the new value (as object). The returned object must be castable to V.

Returns
Type Description
Task<object>

A Task whose Result is a Dictionary<K,V> containing all the transformed values. Await and then cast back to IDictionary<K,V> to enumerate.

TransformEnumerableAsync(object, Func<int, object, Task<object>>)

Asynchronously transforms each element of an IEnumerable<T>, passing in its zero-based index and the element itself, using a Func<int, object, Task<object>>, and returns a List<T> of the transformed elements.

Declaration
public static Task<object> TransformEnumerableAsync(object sourceEnumerable, Func<int, object, Task<object>> indexedTransformer)
Parameters
Type Name Description
object sourceEnumerable

An object implementing IEnumerable<T> for some T.

Func<int, object, Task<object>> indexedTransformer

A function that takes (index, element as object) and returns a Task whose Result is the new element (as object). The returned object must be castable to T.

Returns
Type Description
Task<object>

A Task whose Result is a List<T> (boxed as object) containing all transformed elements. Await and then cast back to IEnumerable<T> to enumerate.

In this article