# AddEntryAttribute

Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0

<div class="api-meta">
<span class="api-kind api-kind-class" data-pagefind-filter="kind:Class">Class</span>
<span data-pagefind-filter="namespace:Sansar.Script">Namespace <a href="/scripting/api/sansar.script"><code>Sansar.Script</code></a></span>
<span>Inherits <a href="https://learn.microsoft.com/dotnet/api/system.attribute">Attribute</a></span>
</div>

<span id="T:Sansar.Script.AddEntryAttribute"></span>

A

```csharp
[System.AttributeUsage(System.AttributeTargets.Field, AllowMultiple=true)]
public class AddEntryAttribute : Attribute
```

## Members at a glance

| Kind | Members |
|---|---|
| **Constructors** | [AddEntryAttribute](#addentryattribute) |

## Constructors

### AddEntryAttribute

<div class="api-card" id="ctor-object">
<span id="M:Sansar.Script.AddEntryAttribute.#ctor(System.Object)"></span>
<span id="C:Sansar.Script.AddEntryAttribute(System.Object)"></span>

```csharp signature
public AddEntryAttribute(object entry)
```

Add an entry to the initial values in the parameter for IList and IDictionary

| Parameter | Type | Description |
|---|---|---|
| `entry` | [object](https://learn.microsoft.com/dotnet/api/system.object) | IDictionary: the key of the entry. IList: the default value of the entry. |

<details class="api-remarks"><summary>Remarks</summary>

For IDictionary sets the key only, with no default value.

For IList sets the default value of the entry.

Has no effect for other parameter types.

</details>

</div>

<div class="api-card" id="ctor-string-object">
<span id="M:Sansar.Script.AddEntryAttribute.#ctor(System.String,System.Object)"></span>
<span id="C:Sansar.Script.AddEntryAttribute(System.String,System.Object)"></span>

```csharp signature
public AddEntryAttribute(string key, object value)
```

Add an entry to the initial values in the parameter for IList and IDictionary

| Parameter | Type | Description |
|---|---|---|
| `key` | [string](https://learn.microsoft.com/dotnet/api/system.string) | IDictionary: the key of the entry. IList: the default value. |
| `value` | [object](https://learn.microsoft.com/dotnet/api/system.object) | IDictionary: the default value of the entry. IList: ignored |

<details class="api-remarks"><summary>Remarks</summary>

For IDictionary sets both a key and a default value for that key.

For IList the value is ignored.

Has no effect for other parameter types.

Can be used multiple times to add multiple entries for IDictionary

</details>

</div>




<p class="api-generated" data-pagefind-ignore>Generated from the Sansar 47.10.0 client ScriptApi snapshot.</p>