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

# EdmReferentialConstraint

> Represents a referential constraint that defines the relationship between properties in a navigation property.

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

## Summary

Represents a referential constraint that defines the relationship between properties
in a navigation property.

## Remarks

Referential constraints specify how foreign key relationships work in OData,
mapping properties from the source entity to properties in the target entity.
They are analogous to foreign key constraints in relational databases.

## Constructors

### &#x20;.ctor

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

#### Syntax

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

### &#x20;.ctor

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

#### Syntax

```csharp theme={null}
public EdmReferentialConstraint(string property, string referencedProperty)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `property` | `string` | The name of the property in the source entity type. |
| `referencedProperty` | `string` | The name of the referenced property in the target entity type. |

#### Exceptions

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

### &#x20;.ctor Inherited

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

#### Syntax

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

## Properties

### &#x20;Property

Gets or sets the name of the property in the source entity type.

#### Syntax

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

#### Property Value

Type: `string`
The name of the property that acts as the foreign key in the source entity.

#### Remarks

This property references a property in the entity type that contains the navigation property.

### &#x20;ReferencedProperty

Gets or sets the name of the referenced property in the target entity type.

#### Syntax

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

#### Property Value

Type: `string`
The name of the property in the target entity that is referenced by the foreign key.

#### Remarks

This is typically a key property in the target entity type. The relationship
is established by matching the value of the Property with the ReferencedProperty.

## Methods

### &#x20;Equals Override

Determines whether the specified object is equal to the current referential constraint.

#### Syntax

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

#### Parameters

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

#### Returns

Type: `bool`
`true` if the specified object is equal to the current referential constraint; 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 referential constraint.

#### Syntax

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

#### Returns

Type: `int`
A hash code for the current referential constraint.

### &#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 referential constraint.

#### Syntax

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

#### Returns

Type: `string`
A string showing the property mapping relationship.

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