> ## 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.

# EdmNavigationProperty

> Represents a navigation property in an OData entity type.

## 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.EdmNavigationProperty
```

## Summary

Represents a navigation property in an OData entity type.

## Remarks

Navigation properties define relationships between entity types, allowing traversal
from one entity to related entities. They can represent both single-valued and
collection-valued relationships.

## Constructors

### &#x20;.ctor

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

#### Syntax

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

### &#x20;.ctor

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

#### Syntax

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

#### Parameters

| Name | Type | Description |
| - | - | - |
| `name` | `string` | The name of the navigation property. |
| `type` | `string` | The type of the navigation property. |

#### 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;ContainsTarget

Gets or sets a value indicating whether the navigation property contains dependent entities.

#### Syntax

```csharp theme={null}
public bool ContainsTarget { get; set; }
```

#### Property Value

Type: `bool`
`true` if this navigation property contains dependent entities; otherwise, `false`.

#### Remarks

When true, this indicates that the target entities depend on the source entity for their existence.
Deleting the source entity should cascade to delete the dependent entities.

### &#x20;Description

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

#### 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;IsCollection

Gets a value indicating whether this navigation property represents a collection.

#### Syntax

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

#### Property Value

Type: `bool`
`true` if the navigation property is collection-valued; otherwise, `false`.

### &#x20;IsRequired

Gets a value indicating whether the navigation property is required (non-nullable).

#### Syntax

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

#### Property Value

Type: `bool`
`true` if the navigation property is required; otherwise, `false`.

### &#x20;LongDescription

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

#### 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;Multiplicity

Gets the multiplicity of this navigation property.

#### Syntax

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

#### Property Value

Type: `string`
A string indicating the relationship multiplicity.

#### Remarks

Returns "Many" for collection-valued properties, "One" for non-nullable single-valued properties,
and "ZeroOrOne" for nullable single-valued properties.

### &#x20;Name

Gets or sets the name of the navigation property.

#### Syntax

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

#### Property Value

Type: `string`
The navigation property name as defined in the CSDL metadata.

### &#x20;Nullable

Gets or sets a value indicating whether the navigation property can contain null values.

#### Syntax

```csharp theme={null}
public bool Nullable { get; set; }
```

#### Property Value

Type: `bool`
`true` if the navigation property is nullable; otherwise, `false`.

#### Remarks

This property is typically relevant for to-one relationships. Collection-valued
navigation properties are generally non-nullable (the collection itself, not its elements).

### &#x20;OnDelete

Gets or sets the on-delete action for this navigation property.

#### Syntax

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

#### Property Value

Type: `string?`
The action to take when the target entity is deleted, or `null` if not specified.

#### Remarks

Common values include "Cascade" for cascading deletes and "SetNull" for setting the
foreign key to null. The specific behavior depends on the underlying data store.

### &#x20;Partner

Gets or sets the name of the partner navigation property.

#### Syntax

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

#### Property Value

Type: `string?`
The name of the corresponding navigation property on the target entity type, or `null` if not specified.

#### Remarks

The partner property represents the inverse side of a bidirectional relationship.
For example, if Customer has Orders navigation property, Order might have a Customer partner property.

### &#x20;ReferentialConstraints

Gets or sets the referential constraints for this navigation property.

#### Syntax

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

#### Property Value

Type: `System.Collections.Generic.List<Microsoft.OData.Mcp.Core.Models.EdmReferentialConstraint>`
A collection of referential constraints that define the foreign key relationships.

#### Remarks

Referential constraints specify how the navigation property relates to properties
in the source and target entity types, effectively defining foreign key relationships.

### &#x20;TargetType

Gets the target entity type name.

#### Syntax

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

#### Property Value

Type: `string`
The fully qualified name of the target entity type.

#### Remarks

For collection-valued navigation properties, this returns the element type within the Collection().
For single-valued properties, this returns the type directly.

### &#x20;TargetTypeName

Gets the target type name of the navigation property.

#### Syntax

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

#### Property Value

Type: `string`
The target entity type name without Collection() wrapper.

### &#x20;Type

Gets or sets the type of the navigation property.

#### Syntax

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

#### Property Value

Type: `string`
The target entity type, optionally wrapped in Collection() for to-many relationships.

## Methods

### &#x20;Equals Override

Determines whether the specified object is equal to the current navigation property.

#### Syntax

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

#### Parameters

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

#### Returns

Type: `bool`
`true` if the specified object is equal to the current navigation property; 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;GetHashCode Override

Returns a hash code for the current navigation property.

#### Syntax

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

#### Returns

Type: `int`
A hash code for the current navigation property.

### &#x20;GetHashCode Inherited Virtual

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

#### Syntax

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

#### Returns

Type: `int`

### &#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;ToString Override

Returns a string representation of the navigation property.

#### Syntax

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

#### Returns

Type: `string`
A string containing the navigation property 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.