Skip to main content

Definition

Assembly: CloudNimble.BlazorEssentials.TursoDb.dll Namespace: CloudNimble.BlazorEssentials.TursoDb.Schema Inheritance: System.Object

Syntax

CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata

Summary

Contains metadata about an entity type for database operations.

Constructors

.ctor

Initializes a new instance of the EntityMetadata class.

Syntax

public EntityMetadata(System.Type entityType)

Parameters

NameTypeDescription
entityTypeSystem.TypeThe entity type to analyze.

.ctor Inherited

Inherited from object

Syntax

public Object()

Properties

Columns

Gets the list of columns in the entity.

Syntax

public System.Collections.Generic.IReadOnlyList<CloudNimble.BlazorEssentials.TursoDb.Schema.ColumnMetadata> Columns { get; }

Property Value

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

EntityType

Gets the entity type.

Syntax

public System.Type EntityType { get; }

Property Value

Type: System.Type

NonKeyColumns

Gets the columns that are not the primary key.

Syntax

public System.Collections.Generic.IReadOnlyList<CloudNimble.BlazorEssentials.TursoDb.Schema.ColumnMetadata> NonKeyColumns { get; }

Property Value

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

PrimaryKey

Gets the primary key column, or null if none.

Syntax

public CloudNimble.BlazorEssentials.TursoDb.Schema.ColumnMetadata PrimaryKey { get; }

Property Value

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

TableName

Gets the table name in the database.

Syntax

public string TableName { get; }

Property Value

Type: string

Methods

Equals Inherited Virtual

Inherited from object

Syntax

public virtual bool Equals(object obj)

Parameters

NameTypeDescription
objobject?-

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

public static bool Equals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

GetHashCode Inherited Virtual

Inherited from object

Syntax

public virtual int GetHashCode()

Returns

Type: int

GetInsertData

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

Syntax

public (string, string, object[]) GetInsertData(object entity)

Parameters

NameTypeDescription
entityobjectThe entity instance.

Returns

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

GetPrimaryKeyValue

Gets the primary key value from an entity.

Syntax

public object GetPrimaryKeyValue(object entity)

Parameters

NameTypeDescription
entityobjectThe entity instance.

Returns

Type: object? The primary key value.

Exceptions

ExceptionDescription
InvalidOperationExceptionThrown when no primary key is defined.

GetType Inherited

Inherited from object

Syntax

public System.Type GetType()

Returns

Type: System.Type

GetUpdateData

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

Syntax

public (string, object[]) GetUpdateData(object entity)

Parameters

NameTypeDescription
entityobjectThe entity instance.

Returns

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

MemberwiseClone Inherited

Inherited from object

Syntax

protected internal object MemberwiseClone()

Returns

Type: object

ReferenceEquals Inherited

Inherited from object

Syntax

public static bool ReferenceEquals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

SetPrimaryKeyValue

Sets the primary key value on an entity.

Syntax

public void SetPrimaryKeyValue(object entity, object value)

Parameters

NameTypeDescription
entityobjectThe entity instance.
valueobject?The primary key value.

Exceptions

ExceptionDescription
InvalidOperationExceptionThrown when no primary key is defined.

ToString Inherited Virtual

Inherited from object

Syntax

public virtual string ToString()

Returns

Type: string?