> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.nimbleapps.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# EntityMetadata

> Contains metadata about an entity type for database operations.

## Definition

**Assembly:** CloudNimble.BlazorEssentials.TursoDb.dll

**Namespace:** CloudNimble.BlazorEssentials.TursoDb.Schema

**Inheritance:** System.Object

## Syntax

```csharp theme={"dark"}
CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata
```

## Summary

Contains metadata about an entity type for database operations.

## Constructors

### &#x20;.ctor

Initializes a new instance of the [EntityMetadata](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/Schema/EntityMetadata.md) class.

#### Syntax

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

#### Parameters

| Name | Type | Description |
| - | - | - |
| `entityType` | `System.Type` | The entity type to analyze. |

### &#x20;.ctor Inherited

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

#### Syntax

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

## Properties

### &#x20;Columns

Gets the list of columns in the entity.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.IReadOnlyList<CloudNimble.BlazorEssentials.TursoDb.Schema.ColumnMetadata> Columns { get; }
```

#### Property Value

Type: `System.Collections.Generic.IReadOnlyList<CloudNimble.BlazorEssentials.TursoDb.Schema.ColumnMetadata>`

### &#x20;EntityType

Gets the entity type.

#### Syntax

```csharp theme={"dark"}
public System.Type EntityType { get; }
```

#### Property Value

Type: `System.Type`

### &#x20;NonKeyColumns

Gets the columns that are not the primary key.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.IReadOnlyList<CloudNimble.BlazorEssentials.TursoDb.Schema.ColumnMetadata> NonKeyColumns { get; }
```

#### Property Value

Type: `System.Collections.Generic.IReadOnlyList<CloudNimble.BlazorEssentials.TursoDb.Schema.ColumnMetadata>`

### &#x20;PrimaryKey

Gets the primary key column, or null if none.

#### Syntax

```csharp theme={"dark"}
public CloudNimble.BlazorEssentials.TursoDb.Schema.ColumnMetadata PrimaryKey { get; }
```

#### Property Value

Type: `CloudNimble.BlazorEssentials.TursoDb.Schema.ColumnMetadata?`

### &#x20;TableName

Gets the table name in the database.

#### Syntax

```csharp theme={"dark"}
public string TableName { get; }
```

#### Property Value

Type: `string`

## Methods

### &#x20;Equals Inherited Virtual

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

#### Syntax

```csharp theme={"dark"}
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={"dark"}
public static bool Equals(object objA, object objB)
```

#### Parameters

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

#### Returns

Type: `bool`

### &#x20;GetHashCode Inherited Virtual

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

#### Syntax

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

#### Returns

Type: `int`

### &#x20;GetInsertData

Gets the column values for insert, excluding auto-increment primary keys with default values.

#### Syntax

```csharp theme={"dark"}
public (string, string, object[]) GetInsertData(object entity)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `entity` | `object` | The entity instance. |

#### Returns

Type: `(string, string, object?[])`
Column names, placeholders, and parameter values.

### &#x20;GetPrimaryKeyValue

Gets the primary key value from an entity.

#### Syntax

```csharp theme={"dark"}
public object GetPrimaryKeyValue(object entity)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `entity` | `object` | The entity instance. |

#### Returns

Type: `object?`
The primary key value.

#### Exceptions

| Exception | Description |
| - | - |
| `InvalidOperationException` | Thrown when no primary key is defined. |

### &#x20;GetType Inherited

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

#### Syntax

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

#### Returns

Type: `System.Type`

### &#x20;GetUpdateData

Gets the column values for update, excluding the primary key.

#### Syntax

```csharp theme={"dark"}
public (string, object[]) GetUpdateData(object entity)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `entity` | `object` | The entity instance. |

#### Returns

Type: `(string, object?[])`
SET clause and parameter values including the primary key.

### &#x20;MemberwiseClone Inherited

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

#### Syntax

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

#### Returns

Type: `object`

### &#x20;ReferenceEquals Inherited

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

#### Syntax

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

#### Parameters

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

#### Returns

Type: `bool`

### &#x20;SetPrimaryKeyValue

Sets the primary key value on an entity.

#### Syntax

```csharp theme={"dark"}
public void SetPrimaryKeyValue(object entity, object value)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `entity` | `object` | The entity instance. |
| `value` | `object?` | The primary key value. |

#### Exceptions

| Exception | Description |
| - | - |
| `InvalidOperationException` | Thrown when no primary key is defined. |

### &#x20;ToString Inherited Virtual

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

#### Syntax

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

#### Returns

Type: `string?`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.