> ## Documentation Index
> Fetch the complete documentation index at: https://ai.easyaf.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# EdmSingleton

> Represents a singleton in an OData entity container.

## Definition

**Assembly:** Microsoft.OData.Mcp.Core.dll

**Namespace:** Microsoft.OData.Mcp.Core.Models

**Inheritance:** System.Object

## Syntax

```csharp theme={null}
Microsoft.OData.Mcp.Core.Models.EdmSingleton
```

## Summary

Represents a singleton in an OData entity container.

## Remarks

Singletons represent individual entity instances that are addressable as single resources
rather than collections. They are useful for representing unique entities like service
configuration, user profiles, or system settings that exist as single instances.

## Constructors

### &#x20;.ctor

Initializes a new instance of the [EdmSingleton](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmSingleton.md) class.

#### Syntax

```csharp theme={null}
public EdmSingleton()
```

### &#x20;.ctor

Initializes a new instance of the [EdmSingleton](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmSingleton.md) class with the specified name and type.

#### Syntax

```csharp theme={null}
public EdmSingleton(string name, string type)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `name` | `string` | The name of the singleton. |
| `type` | `string` | The entity type of the singleton. |

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentException` | Thrown when *name* or *type* is null or whitespace. |

### &#x20;.ctor Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
public Object()
```

## Properties

### &#x20;Annotations

Gets or sets the annotations for this singleton.

#### Syntax

```csharp theme={null}
public System.Collections.Generic.Dictionary<string, object> Annotations { get; set; }
```

#### Property Value

Type: `System.Collections.Generic.Dictionary<string, object>`
A dictionary of annotations that provide additional metadata about the singleton.

#### Remarks

Annotations can be used to specify additional behaviors, constraints, or metadata
that are not captured by the standard OData model elements.

### &#x20;Description

Gets or sets the CSDL documentation summary or `Core.Description` for this singleton.

#### Syntax

```csharp theme={null}
public string Description { get; set; }
```

#### Property Value

Type: `string?`
A human-readable summary from metadata, or `null` when none is declared.

### &#x20;HasNavigationPropertyBindings

Gets a value indicating whether this singleton has any navigation property bindings.

#### Syntax

```csharp theme={null}
public bool HasNavigationPropertyBindings { get; }
```

#### Property Value

Type: `bool`
`true` if the singleton has navigation property bindings; otherwise, `false`.

### &#x20;LongDescription

Gets or sets the CSDL long description or `Core.LongDescription` for this singleton.

#### Syntax

```csharp theme={null}
public string LongDescription { get; set; }
```

#### Property Value

Type: `string?`
A longer documentation string from metadata, or `null` when none is declared.

### &#x20;Name

Gets or sets the name of the singleton.

#### Syntax

```csharp theme={null}
public required string Name { get; set; }
```

#### Property Value

Type: `string`
The name used to address this singleton in OData URLs.

#### Remarks

The singleton name appears in the URL path when accessing the individual entity.

### &#x20;NavigationPropertyBindings

Gets or sets the navigation property bindings for this singleton.

#### Syntax

```csharp theme={null}
public System.Collections.Generic.List<Microsoft.OData.Mcp.Core.Models.EdmNavigationPropertyBinding> NavigationPropertyBindings { get; set; }
```

#### Property Value

Type: `System.Collections.Generic.List<Microsoft.OData.Mcp.Core.Models.EdmNavigationPropertyBinding>`
A collection of navigation property bindings that establish relationships with other entity sets or singletons.

#### Remarks

Navigation property bindings specify which entity set or singleton should be used when following
a navigation property from this singleton. They establish the connections between related
resources in the model.

### &#x20;Type

Gets or sets the entity type of the singleton.

#### Syntax

```csharp theme={null}
public required string Type { get; set; }
```

#### Property Value

Type: `string`
The fully qualified name of the entity type for this singleton.

#### Remarks

The singleton instance must be of this entity type or one of its derived types.
This determines the structure and properties available for the singleton.

### &#x20;TypeName

Gets the short name of the entity type (without namespace).

#### Syntax

```csharp theme={null}
public string TypeName { get; }
```

#### Property Value

Type: `string`
The entity type name without the namespace prefix.

### &#x20;TypeNamespace

Gets the namespace of the entity type.

#### Syntax

```csharp theme={null}
public string TypeNamespace { get; }
```

#### Property Value

Type: `string`
The namespace portion of the entity type, or an empty string if no namespace.

## Methods

### &#x20;AddAnnotation

Adds an annotation to this singleton.

#### Syntax

```csharp theme={null}
public void AddAnnotation(string term, object value)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `term` | `string` | The annotation term. |
| `value` | `object` | The annotation value. |

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentException` | Thrown when *term* is null or whitespace. |

### &#x20;AddNavigationPropertyBinding

Adds a navigation property binding to this singleton.

#### Syntax

```csharp theme={null}
public void AddNavigationPropertyBinding(string navigationPropertyPath, string target)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `navigationPropertyPath` | `string` | The path of the navigation property. |
| `target` | `string` | The target entity set or singleton name. |

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentException` | Thrown when *navigationPropertyPath* or *target* is null or whitespace. |

### &#x20;Equals Override

Determines whether the specified object is equal to the current singleton.

#### Syntax

```csharp theme={null}
public override bool Equals(object obj)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `obj` | `object?` | The object to compare with the current singleton. |

#### Returns

Type: `bool`
`true` if the specified object is equal to the current singleton; otherwise, `false`.

### &#x20;Equals Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
public virtual bool Equals(object obj)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `obj` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;Equals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
public static bool Equals(object objA, object objB)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `objA` | `object?` | - |
| `objB` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;GetAnnotation

Gets an annotation value by term.

#### Syntax

```csharp theme={null}
public T GetAnnotation<T>(string term)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `term` | `string` | The annotation term. |

#### Returns

Type: `T?`
The annotation value, or the default value of *T* if not found.

#### Type Parameters

* `T` - The type of the annotation value.

### &#x20;GetHashCode Override

Returns a hash code for the current singleton.

#### Syntax

```csharp theme={null}
public override int GetHashCode()
```

#### Returns

Type: `int`
A hash code for the current singleton.

### &#x20;GetHashCode Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
public virtual int GetHashCode()
```

#### Returns

Type: `int`

### &#x20;GetNavigationPropertyBinding

Gets a navigation property binding by navigation property path.

#### Syntax

```csharp theme={null}
public Microsoft.OData.Mcp.Core.Models.EdmNavigationPropertyBinding GetNavigationPropertyBinding(string navigationPropertyPath)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `navigationPropertyPath` | `string` | The path of the navigation property. |

#### Returns

Type: `Microsoft.OData.Mcp.Core.Models.EdmNavigationPropertyBinding?`
The navigation property binding with the specified path, or `null` if not found.

### &#x20;GetType Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
public System.Type GetType()
```

#### Returns

Type: `System.Type`

### &#x20;MemberwiseClone Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
protected internal object MemberwiseClone()
```

#### Returns

Type: `object`

### &#x20;ReferenceEquals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
public static bool ReferenceEquals(object objA, object objB)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `objA` | `object?` | - |
| `objB` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;RemoveNavigationPropertyBinding

Removes a navigation property binding from this singleton.

#### Syntax

```csharp theme={null}
public bool RemoveNavigationPropertyBinding(string navigationPropertyPath)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `navigationPropertyPath` | `string` | The path of the navigation property to remove. |

#### Returns

Type: `bool`
`true` if the binding was removed; otherwise, `false`.

### &#x20;ToString Override

Returns a string representation of the singleton.

#### Syntax

```csharp theme={null}
public override string ToString()
```

#### Returns

Type: `string`
A string containing the singleton name and type.

### &#x20;ToString Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
public virtual string ToString()
```

#### Returns

Type: `string?`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.