Table of Contents

Class ImmutableEquatableDictionary

Namespace
PolyType.Roslyn
Assembly
PolyType.Roslyn.dll

Provides a set of static methods for creating instances of ImmutableEquatableDictionary<TKey, TValue>.

public static class ImmutableEquatableDictionary
Inheritance
ImmutableEquatableDictionary
Inherited Members

Methods

Empty<TKey, TValue>()

public static ImmutableEquatableDictionary<TKey, TValue> Empty<TKey, TValue>() where TKey : IEquatable<TKey> where TValue : IEquatable<TValue>

Returns

ImmutableEquatableDictionary<TKey, TValue>

An empty ImmutableEquatableDictionary<TKey, TValue> instance.

Type Parameters

TKey

The key type of the dictionary.

TValue

The value type of the dictionary.

ToImmutableEquatableDictionary<TKey, TValue>(IEnumerable<KeyValuePair<TKey, TValue>>)

Creates an ImmutableEquatableDictionary<TKey, TValue> instance from the specified values.

public static ImmutableEquatableDictionary<TKey, TValue> ToImmutableEquatableDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> values) where TKey : IEquatable<TKey> where TValue : IEquatable<TValue>

Parameters

values IEnumerable<KeyValuePair<TKey, TValue>>

The source key/value pairs with which to populate the dictionary.

Returns

ImmutableEquatableDictionary<TKey, TValue>

An ImmutableEquatableDictionary<TKey, TValue> containing the specified values.

Type Parameters

TKey

The key type of the dictionary.

TValue

The value type of the dictionary.

ToImmutableEquatableDictionary<TKey, TValue>(IEnumerable<TValue>, Func<TValue, TKey>)

Creates an ImmutableEquatableDictionary<TKey, TValue> instance from the specified values.

public static ImmutableEquatableDictionary<TKey, TValue> ToImmutableEquatableDictionary<TKey, TValue>(this IEnumerable<TValue> values, Func<TValue, TKey> keySelector) where TKey : IEquatable<TKey> where TValue : IEquatable<TValue>

Parameters

values IEnumerable<TValue>

The source values used to populate the dictionary.

keySelector Func<TValue, TKey>

The projection function from which to derive a key.

Returns

ImmutableEquatableDictionary<TKey, TValue>

An ImmutableEquatableDictionary<TKey, TValue> containing the specified values.

Type Parameters

TKey

The key type of the dictionary.

TValue

The value type of the dictionary.

ToImmutableEquatableDictionary<TSource, TKey, TValue>(IEnumerable<TSource>, Func<TSource, TKey>, Func<TSource, TValue>)

Creates an ImmutableEquatableDictionary<TKey, TValue> instance from the specified values.

public static ImmutableEquatableDictionary<TKey, TValue> ToImmutableEquatableDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> valueSelector) where TKey : IEquatable<TKey> where TValue : IEquatable<TValue>

Parameters

source IEnumerable<TSource>

The source enumerable seeding the dictionary entries.

keySelector Func<TSource, TKey>

The projection function from which to derive a key.

valueSelector Func<TSource, TValue>

The projection function from which to derive a value.

Returns

ImmutableEquatableDictionary<TKey, TValue>

An ImmutableEquatableDictionary<TKey, TValue> containing the specified values.

Type Parameters

TSource

The element type of the source enumerable.

TKey

The key type of the dictionary.

TValue

The value type of the dictionary.