> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/reactor/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinematicsoup.gitbook.io/reactor/api-reference/ks.reactor/ks.reactor.ksconstmap-2.md).

# Class ksConstMap\<Key, Value>

Namespace: [KS.Reactor](/reactor/api-reference/ks.reactor.md)\
Assembly: KSCommon.dll

Wraps a dictionary and provides read-only access to it.

```csharp
public class ksConstMap<Key, Value> : IEnumerable<KeyValuePair<Key, Value>>, IEnumerable
```

#### Type Parameters

`Key`

`Value`

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ← [ksConstMap\<Key, Value>](/reactor/api-reference/ks.reactor/ks.reactor.ksconstmap-2.md)

#### Implements

[IEnumerable\<KeyValuePair\<Key, Value>>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1), [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.ienumerable)

#### Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)), [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)), [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype), [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Constructors

### ksConstMap(Dictionary\<Key, Value>) <a href="#ks_reactor_ksconstmap_2__ctor_system_collections_generic_dictionary__0__1" id="ks_reactor_ksconstmap_2__ctor_system_collections_generic_dictionary__0__1"></a>

Constructor.

```csharp
public ksConstMap(Dictionary<Key, Value> map)
```

#### Parameters

`map` [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2)\<Key, Value>

## Properties

### Count <a href="#ks_reactor_ksconstmap_2_count" id="ks_reactor_ksconstmap_2_count"></a>

Number of entries in the map.

```csharp
public int Count { get; }
```

#### Property Value

[int](https://learn.microsoft.com/dotnet/api/system.int32)

### this\[Key] <a href="#ks_reactor_ksconstmap_2_item__0" id="ks_reactor_ksconstmap_2_item__0"></a>

Gets a value from the map.

```csharp
public Value this[Key key] { get; }
```

#### Property Value

Value

## Methods

### Contains(Key) <a href="#ks_reactor_ksconstmap_2_contains__0" id="ks_reactor_ksconstmap_2_contains__0"></a>

Checks if a key is in the map.

```csharp
public bool Contains(Key key)
```

#### Parameters

`key` Key

Key to check.

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

True if the key is in the map.

### GetEnumerator() <a href="#ks_reactor_ksconstmap_2_getenumerator" id="ks_reactor_ksconstmap_2_getenumerator"></a>

Gets the enumerator for the map.

```csharp
public IEnumerator<KeyValuePair<Key, Value>> GetEnumerator()
```

#### Returns

[IEnumerator](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerator-1)<[KeyValuePair](https://learn.microsoft.com/dotnet/api/system.collections.generic.keyvaluepair-2)\<Key, Value>>

Enumerator for the map.

### TryGetValue(Key, out Value) <a href="#ks_reactor_ksconstmap_2_trygetvalue__0__1" id="ks_reactor_ksconstmap_2_trygetvalue__0__1"></a>

Tries to get a value from the map.

```csharp
public bool TryGetValue(Key key, out Value value)
```

#### Parameters

`key` Key

Key to get value for.

`value` Value

Value for the key.

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

True if the key was found.
