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

# EdmProperty

> Represents a property in an OData entity type or complex 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.EdmProperty
```

## Summary

Represents a property in an OData entity type or complex type.

## Remarks

Properties define the structure and data characteristics of entity types and complex types.
They specify the name, type, and various constraints of the data elements.
Only members declared on the EDM belong here. Ignored CLR properties must not be added.

## Constructors

### &#x20;.ctor

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

#### Syntax

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

### &#x20;.ctor

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

#### Syntax

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

#### Parameters

| Name | Type | Description |
| - | - | - |
| `name` | `string` | The name of the property. |
| `type` | `string` | The type of the 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;Computed

Gets or sets a value indicating whether the service computes this property's value.

#### Syntax

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

#### Property Value

Type: `bool`
`true` when the metadata declares `Org.OData.Core.V1.Computed` or `Org.OData.Core.V1.ComputedDefaultValue`; otherwise, `false`.

#### Remarks

A computed property is store-generated and therefore optional on create even when it is non-nullable.
This flag is set only from those vocabulary terms. It is never inferred from the property type or key membership.

### &#x20;DefaultValue

Gets or sets the default value of the property.

#### Syntax

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

#### Property Value

Type: `string?`
The default value as a string, or `null` if not specified.

#### Remarks

The default value is represented as it appears in the CSDL metadata.
Type-specific parsing is required when using this value.

### &#x20;Description

Gets or sets the description of the property.

#### Syntax

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

#### Property Value

Type: `string?`
A human-readable description of the property's purpose.

### &#x20;ElementType

Gets the element type for collection properties.

#### Syntax

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

#### Property Value

Type: `string`
The element type of the collection, or the type itself if not a collection.

### &#x20;HasDefaultValue

Gets a value indicating whether the property has a default value.

#### Syntax

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

#### Property Value

Type: `bool`
`true` if the property has a default value; otherwise, `false`.

### &#x20;IsCollection

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

#### Syntax

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

#### Property Value

Type: `bool`
`true` if the property type is a collection; otherwise, `false`.

### &#x20;IsKey

Gets or sets a value indicating whether this property is part of the entity key.

#### Syntax

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

#### Property Value

Type: `bool`
`true` if the property is a key property; otherwise, `false`.

#### Remarks

Key properties uniquely identify an entity instance and are typically non-nullable.

### &#x20;IsNullable

Gets a value indicating whether the property is nullable (alias for Nullable property).

#### Syntax

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

#### Property Value

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

### &#x20;IsPrimitive

Gets a value indicating whether this property represents a primitive type.

#### Syntax

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

#### Property Value

Type: `bool`
`true` if the property type is an EDM primitive type; otherwise, `false`.

### &#x20;LongDescription

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

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

Gets or sets the maximum length of the property value.

#### Syntax

```csharp theme={null}
public System.Nullable<int> MaxLength { get; set; }
```

#### Property Value

Type: `System.Nullable<int>?`
The maximum length, or `null` if not specified.

#### Remarks

This constraint applies primarily to string and binary properties.
A value of "Max" in the metadata is represented as `null` here.

### &#x20;Name

Gets or sets the name of the property.

#### Syntax

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

#### Property Value

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

### &#x20;Nullable

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

#### Syntax

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

#### Property Value

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

#### Remarks

When not specified in the metadata, this property defaults to `true` for most types,
except for key properties which are typically non-nullable.

### &#x20;Precision

Gets or sets the precision of the property value.

#### Syntax

```csharp theme={null}
public System.Nullable<int> Precision { get; set; }
```

#### Property Value

Type: `System.Nullable<int>?`
The precision, or `null` if not specified.

#### Remarks

Precision applies to decimal and temporal types, indicating the total number of digits.

### &#x20;Scale

Gets or sets the scale of the property value.

#### Syntax

```csharp theme={null}
public System.Nullable<int> Scale { get; set; }
```

#### Property Value

Type: `System.Nullable<int>?`
The scale, or `null` if not specified.

#### Remarks

Scale applies to decimal types, indicating the number of digits after the decimal point.
A value of "Variable" in the metadata is represented as `null` here.

### &#x20;SRID

Gets or sets the SRID (Spatial Reference System Identifier) for spatial properties.

#### Syntax

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

#### Property Value

Type: `string?`
The SRID value, or `null` if not applicable or not specified.

#### Remarks

This property is relevant only for geography and geometry types.

### &#x20;Type

Gets or sets the type of the property.

#### Syntax

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

#### Property Value

Type: `string`
The fully qualified type name (e.g., "Edm.String", "Namespace.EntityType").

### &#x20;TypeName

Gets the type name of the property (alias for Type property).

#### Syntax

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

#### Property Value

Type: `string`
The fully qualified type name (e.g., "Edm.String", "Namespace.EntityType").

### &#x20;Unicode

Gets or sets a value indicating whether the property uses Unicode encoding.

#### Syntax

```csharp theme={null}
public System.Nullable<bool> Unicode { get; set; }
```

#### Property Value

Type: `System.Nullable<bool>?`
`true` if Unicode is enabled; `false` if disabled; `null` if not specified.

#### Remarks

This property applies to string properties and affects how the data is stored and transmitted.

## Methods

### &#x20;Equals Override

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

#### Syntax

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

#### Parameters

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

#### Returns

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

#### Syntax

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

#### Returns

Type: `int`
A hash code for the current 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 property.

#### Syntax

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

#### Returns

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