Definition
Assembly: Microsoft.OData.Mcp.Core.dll Namespace: Microsoft.OData.Mcp.Core.Models Inheritance: System.ObjectSyntax
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
.ctor
Initializes a new instance of the EdmReferentialConstraint class.Syntax
.ctor
Initializes a new instance of the EdmReferentialConstraint class with the specified property names.Syntax
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. |
.ctor Inherited
Inherited from
objectSyntax
Properties
Property
Gets or sets the name of the property in the source entity type.Syntax
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.ReferencedProperty
Gets or sets the name of the referenced property in the target entity type.Syntax
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
Equals Override
Determines whether the specified object is equal to the current referential constraint.Syntax
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.
Equals Inherited Virtual
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
obj | object? | - |
Returns
Type:bool
Equals Inherited
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
objA | object? | - |
objB | object? | - |
Returns
Type:bool
GetHashCode Override
Returns a hash code for the current referential constraint.Syntax
Returns
Type:int
A hash code for the current referential constraint.
GetHashCode Inherited Virtual
Inherited from
objectSyntax
Returns
Type:int
GetType Inherited
Inherited from
objectSyntax
Returns
Type:System.Type
MemberwiseClone Inherited
Inherited from
objectSyntax
Returns
Type:object
ReferenceEquals Inherited
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
objA | object? | - |
objB | object? | - |
Returns
Type:bool
ToString Override
Returns a string representation of the referential constraint.Syntax
Returns
Type:string
A string showing the property mapping relationship.
ToString Inherited Virtual
Inherited from
objectSyntax
Returns
Type:string?