Schema

Ecng.Serialization

Describes the database schema for an entity type.

Свойства

AllColumns
public IReadOnlyList<SchemaColumn> AllColumns { get; }
value = schema.AllColumns

Gets all columns including the identity column.

Columns
public IReadOnlyList<SchemaColumn> Columns { get; set; }
value = schema.Columns
schema.Columns = value

Gets or sets the non-identity columns of the schema.

EntityType
public Type EntityType { get; set; }
value = schema.EntityType
schema.EntityType = value

Gets the CLR entity type this schema describes.

Factory
public Func<object> Factory { get; set; }
value = schema.Factory
schema.Factory = value

Gets the factory delegate used to create new entity instances.

Identity
public SchemaColumn Identity { get; set; }
value = schema.Identity
schema.Identity = value

Gets or sets the identity (primary key) column, or null if none.

IndexColumns
public IReadOnlyList<SchemaColumn> IndexColumns { get; }
value = schema.IndexColumns

Gets columns that are indexed.

IsInitialized
public bool IsInitialized { get; private set; }
value = schema.IsInitialized
schema.IsInitialized = value

True after SchemaColumn}) has filled in the reflection-derived metadata. SchemaRegistry exposes only initialised instances through TryGet so a parallel reader cannot observe a half-built schema while another thread is still walking properties.

IsView
public bool IsView { get; set; }
value = schema.IsView
schema.IsView = value

Gets whether this schema maps to a database view.

Name
public string Name { get; }
value = schema.Name

Gets the schema name (alias for TableName).

NoCache
public bool NoCache { get; set; }
value = schema.NoCache
schema.NoCache = value

Gets whether caching is disabled for this schema.

NonReadOnlyColumns
public IReadOnlyList<SchemaColumn> NonReadOnlyColumns { get; }
value = schema.NonReadOnlyColumns

Gets columns that are writable (not read-only).

ReadOnly
public bool ReadOnly { get; }
value = schema.ReadOnly

Gets whether the schema is effectively read-only (no writable columns).

ReadOnlyColumns
public IReadOnlyList<SchemaColumn> ReadOnlyColumns { get; }
value = schema.ReadOnlyColumns

Gets columns that are read-only.

TableName
public string TableName { get; set; }
value = schema.TableName
schema.TableName = value

Gets the database table name.

UniqueColumns
public IReadOnlyList<SchemaColumn> UniqueColumns { get; }
value = schema.UniqueColumns

Gets columns that have a unique constraint.

Методы

CreateEntity
public object CreateEntity()
result = schema.CreateEntity()

Creates a new entity instance using the configured factory.

SetColumnsAndIdentity
internal void SetColumnsAndIdentity(SchemaColumn identity, IReadOnlyList<SchemaColumn> columns)
schema.SetColumnsAndIdentity(identity, columns)

Sets identity and columns in a single call, resetting derived caches. Used by SchemaRegistry for two-phase initialization.

TryGetColumn
public SchemaColumn TryGetColumn(string name)
result = schema.TryGetColumn(name)

Tries to find a column by name (case-insensitive), returning null if not found.