Definition
Assembly: Microsoft.OData.Mcp.Core.dll Namespace: Microsoft.OData.Mcp.Core.Models Inheritance: System.ObjectSyntax
Summary
Represents an entity type in an OData model.Remarks
Entity types define the structure of entities in an OData service, including their properties, navigation properties, and key definitions. They form the foundation of the entity data model and determine how data is structured and accessed.Constructors
.ctor
Initializes a new instance of the EdmEntityType class.Syntax
.ctor
Initializes a new instance of the EdmEntityType class with the specified name and namespace.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
name | string | The name of the entity type. |
namespace | string | The namespace of the entity type. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException | Thrown when name or namespace is null or whitespace. |
.ctor Inherited
Inherited from
objectSyntax
Properties
Abstract
Gets or sets a value indicating whether this entity type is abstract.Syntax
Property Value
Type:bool
true if the entity type is abstract; otherwise, false.
Remarks
Abstract entity types cannot be instantiated directly but can serve as base types for other entity types. They are useful for defining common properties and behaviors.BaseType
Gets or sets the base type of the entity type.Syntax
Property Value
Type:string?
The fully qualified name of the base entity type, or null if this type has no base type.
Remarks
When specified, this entity type inherits all properties and navigation properties from the base type. The inheritance hierarchy must be consistent within the model.FullName
Gets the fully qualified name of the entity type.Syntax
Property Value
Type:string
The namespace and name combined with a dot separator.
HasBaseType
Gets a value indicating whether this entity type inherits from another entity type.Syntax
Property Value
Type:bool
true if the entity type has a base type; otherwise, false.
HasNavigationProperties
Gets a value indicating whether this entity type has any navigation properties.Syntax
Property Value
Type:bool
true if the entity type has navigation properties; otherwise, false.
HasStream
Gets or sets a value indicating whether this entity type has a stream.Syntax
Property Value
Type:bool
true if the entity type has a stream; otherwise, false.
Remarks
When true, instances of this entity type can have an associated media resource (such as a photo or document) that can be accessed via streaming operations.IsAbstract
Gets a value indicating whether this entity type is abstract.Syntax
Property Value
Type:bool
true if the entity type is abstract; otherwise, false.
Remarks
This is an alias for the EdmEntityType.Abstract property for compatibility.Key
Gets or sets the key properties of the entity type.Syntax
Property Value
Type:System.Collections.Generic.List<string>
A collection of property names that form the entity key.
Remarks
Key properties uniquely identify instances of the entity type. They are used for addressing individual entities and establishing relationships.KeyProperties
Gets the key properties as EdmProperty objects.Syntax
Property Value
Type:System.Collections.Generic.IEnumerable<Microsoft.OData.Mcp.Core.Models.EdmProperty>
A collection of properties that form the entity key.
Name
Gets or sets the name of the entity type.Syntax
Property Value
Type:string
The local name of the entity type within its namespace.
Namespace
Gets or sets the namespace of the entity type.Syntax
Property Value
Type:string
The namespace that contains this entity type.
NavigationProperties
Gets or sets the navigation properties of the entity type.Syntax
Property Value
Type:System.Collections.Generic.List<Microsoft.OData.Mcp.Core.Models.EdmNavigationProperty>
A collection of navigation properties that define relationships to other entities.
Remarks
Navigation properties enable traversal between related entities and define the relationship structure of the data model.NonKeyProperties
Gets the non-key properties of the entity type.Syntax
Property Value
Type:System.Collections.Generic.IEnumerable<Microsoft.OData.Mcp.Core.Models.EdmProperty>
A collection of properties that are not part of the entity key.
OpenType
Gets or sets a value indicating whether this entity type is open.Syntax
Property Value
Type:bool
true if the entity type is open; otherwise, false.
Remarks
Open entity types allow additional properties beyond those explicitly defined in the metadata. This provides flexibility for dynamic scenarios where the complete structure may not be known at design time.Properties
Gets or sets the properties of the entity type.Syntax
Property Value
Type:System.Collections.Generic.List<Microsoft.OData.Mcp.Core.Models.EdmProperty>
A collection of structural properties that define the data elements of the entity.
Remarks
These properties represent the data that can be stored and retrieved for instances of this entity type. They include both key and non-key properties.Methods
Equals Override
Determines whether the specified object is equal to the current entity type.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
obj | object? | The object to compare with the current entity type. |
Returns
Type:bool
true if the specified object is equal to the current entity type; 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 entity type.Syntax
Returns
Type:int
A hash code for the current entity type.
GetHashCode Inherited Virtual
Inherited from
objectSyntax
Returns
Type:int
GetNavigationProperty
Gets a navigation property by name.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
propertyName | string | The name of the navigation property to retrieve. |
Returns
Type:Microsoft.OData.Mcp.Core.Models.EdmNavigationProperty?
The navigation property with the specified name, or null if not found.
GetProperty
Gets a property by name.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
propertyName | string | The name of the property to retrieve. |
Returns
Type:Microsoft.OData.Mcp.Core.Models.EdmProperty?
The property with the specified name, or null if not found.
GetType Inherited
Inherited from
objectSyntax
Returns
Type:System.Type
HasNavigationProperty
Determines whether the entity type has a navigation property with the specified name.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
propertyName | string | The name of the navigation property to check. |
Returns
Type:bool
true if the entity type has the navigation property; otherwise, false.
HasProperty
Determines whether the entity type has a property with the specified name.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
propertyName | string | The name of the property to check. |
Returns
Type:bool
true if the entity type has the property; otherwise, false.
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 entity type.Syntax
Returns
Type:string
The fully qualified name of the entity type.
ToString Inherited Virtual
Inherited from
objectSyntax
Returns
Type:string?