# Metadata

Namespace: **Wisej.AI.Embeddings**

Assembly: **Wisej.AI** (3.5.0.0)

Represents metadata that can store key-value pairs with case-insensitive keys. Implements the [ISerializable](https://docs.wisej.com/api?q=wisej.ai.json.iserializable) interface for JSON serialization.

{% tabs %}
{% tab title="C#" %}

```csharp
public class Metadata : ISerializable
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class Metadata
    Inherits ISerializable
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](/files/ptrKjmmRoQB76pvrIqh0) Metadata()

Initializes a new instance of the [Metadata](/ai/components/api/embeddings/wisej.ai.embeddings.metadata.md) class with empty data.

### ![](/files/ptrKjmmRoQB76pvrIqh0) Metadata(data)

Initializes a new instance of the [Metadata](/ai/components/api/embeddings/wisej.ai.embeddings.metadata.md) class with the specified initial data.

| Name     | Type                                                                                                           | Description                                                                             |
| -------- | -------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| **data** | [IDictionary\<String, Object>](https://docs.microsoft.com/dotnet/api/system.collections.generic.idictionary-2) | Initial data to populate the metadata. If *data* is null, an empty metadata is created. |

### ![](/files/ptrKjmmRoQB76pvrIqh0) Metadata(data)

Initializes a new instance of the [Metadata](/ai/components/api/embeddings/wisej.ai.embeddings.metadata.md) class with data from a [DynamicObject](https://docs.wisej.com/api?q=wisej.core.dynamicobject).

| Name     | Type                                                                   | Description                                                                                                                                        |
| -------- | ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| **data** | [DynamicObject](https://docs.wisej.com/api?q=wisej.core.dynamicobject) | A [DynamicObject](https://docs.wisej.com/api?q=wisej.core.dynamicobject) containing initial data. If *data* is null, an empty metadata is created. |

## Properties

### ![](/files/ptrKjmmRoQB76pvrIqh0) Item(name)

[Object](https://docs.microsoft.com/dotnet/api/system.object): Gets or sets the value associated with the specified name.

**Throws:**

* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception)\
  Thrown when setting a value that is not of type string, number, boolean, or date.

## Methods

### ![](/files/ptrKjmmRoQB76pvrIqh0) Clone()

Creates a new instance of the [Metadata](/ai/components/api/embeddings/wisej.ai.embeddings.metadata.md) class that is a copy of the current instance.

**Returns:** [Metadata](/ai/components/api/embeddings/wisej.ai.embeddings.metadata.md). A new [Metadata](/ai/components/api/embeddings/wisej.ai.embeddings.metadata.md) object that is a copy of this instance.

This method creates a deep copy of the current metadata, allowing modifications to the clone without affecting the original.

```csharp

  var original = new Metadata();
  var clone = original.Clone();

```

### ![](/files/ptrKjmmRoQB76pvrIqh0) GetProperties()

Retrieves all property names within the metadata.

**Returns:** [String\[\]](https://docs.microsoft.com/dotnet/api/system.string). An array of strings containing all property names.

This method returns the keys of all stored metadata entries as an array of strings. If the metadata is empty, it returns an empty array.

```csharp

  var metadata = new Metadata();
  var properties = metadata.GetProperties();

```

### ![](/files/ptrKjmmRoQB76pvrIqh0) Remove(keys)

Removes metadata entries with the specified keys.

| Parameter | Type                                                              | Description                                                  |
| --------- | ----------------------------------------------------------------- | ------------------------------------------------------------ |
| **keys**  | [String\[\]](https://docs.microsoft.com/dotnet/api/system.string) | An array of keys identifying the metadata entries to remove. |

This method will iterate through the provided keys and remove the corresponding entries from the metadata. If the metadata is empty or the keys do not exist, the method does nothing.

```csharp

  var metadata = new Metadata();
  metadata["key1"] = "value1";
  metadata.Remove("key1");

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/ai/components/api/embeddings/wisej.ai.embeddings.metadata.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
