> ## Documentation Index
> Fetch the complete documentation index at: https://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.

export function DocsBadge({text, variant = 'neutral'}) {
  const variantClasses = {
    success: 'mint-bg-green-500/10 mint-text-green-600 dark:mint-text-green-400 mint-border-green-500/20',
    neutral: 'mint-bg-slate-500/10 mint-text-slate-600 dark:mint-text-slate-400 mint-border-slate-500/20',
    info: 'mint-bg-blue-500/10 mint-text-blue-600 dark:mint-text-blue-400 mint-border-blue-500/20',
    warning: 'mint-bg-amber-500/10 mint-text-amber-600 dark:mint-text-amber-400 mint-border-amber-500/20',
    danger: 'mint-bg-red-500/10 mint-text-red-600 dark:mint-text-red-400 mint-border-red-500/20'
  };
  const classes = variantClasses[variant] || variantClasses.neutral;
  return <span className={`mint-inline-flex mint-items-center mint-px-2 mint-py-0.5 mint-rounded-full mint-text-xs mint-font-medium mint-tracking-wide mint-border mint-ml-1.5 mint-align-middle mint-whitespace-nowrap ${classes}`}>
      {text}
    </span>;
}

## Definition

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

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

**Inheritance:** System.Object

## Syntax

```csharp theme={"dark"}
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

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  .ctor

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

#### Syntax

```csharp theme={"dark"}
public EdmReferentialConstraint()
```

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  .ctor

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

#### Syntax

```csharp theme={"dark"}
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. |

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  .ctor <DocsBadge text="Inherited" variant="neutral" />

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public Object()
```

## Properties

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  Property

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

#### Syntax

```csharp theme={"dark"}
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.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  ReferencedProperty

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

#### Syntax

```csharp theme={"dark"}
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

### <Icon icon="code-merge" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  Equals <DocsBadge text="Override" variant="info" />

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

#### Syntax

```csharp theme={"dark"}
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`.

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  Equals <DocsBadge text="Inherited" variant="neutral" /> <DocsBadge text="Virtual" variant="warning" />

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Parameters

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

#### Returns

Type: `bool`

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  Equals <DocsBadge text="Inherited" variant="neutral" />

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Parameters

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

#### Returns

Type: `bool`

### <Icon icon="code-merge" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  GetHashCode <DocsBadge text="Override" variant="info" />

Returns a hash code for the current referential constraint.

#### Syntax

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

#### Returns

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

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  GetHashCode <DocsBadge text="Inherited" variant="neutral" /> <DocsBadge text="Virtual" variant="warning" />

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Returns

Type: `int`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  GetType <DocsBadge text="Inherited" variant="neutral" />

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Returns

Type: `System.Type`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  MemberwiseClone <DocsBadge text="Inherited" variant="neutral" />

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Returns

Type: `object`

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  ReferenceEquals <DocsBadge text="Inherited" variant="neutral" />

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Parameters

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

#### Returns

Type: `bool`

### <Icon icon="code-merge" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  ToString <DocsBadge text="Override" variant="info" />

Returns a string representation of the referential constraint.

#### Syntax

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

#### Returns

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

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  ToString <DocsBadge text="Inherited" variant="neutral" /> <DocsBadge text="Virtual" variant="warning" />

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Returns

Type: `string?`
