Table of Contents

Class RelationalColumn

Namespace
eQuantic.Core.Data.Relational
Assembly
eQuantic.Core.Data.Relational.dll

A mapped column: the entity property, its stored name and (optionally) its value converter.

public sealed record RelationalColumn : IEquatable<RelationalColumn>
Inheritance
RelationalColumn
Implements
Inherited Members

Constructors

RelationalColumn(PropertyInfo, string, RelationalConverter?)

A mapped column: the entity property, its stored name and (optionally) its value converter.

public RelationalColumn(PropertyInfo Property, string Name, RelationalConverter? Converter = null)

Parameters

Property PropertyInfo

The entity property.

Name string

The column name (already through the dialect's naming convention or an explicit override).

Converter RelationalConverter

The value converter, or null when the member stores as-is.

Properties

Converter

The value converter, or null when the member stores as-is.

public RelationalConverter? Converter { get; init; }

Property Value

RelationalConverter

DefaultValue

The value existing records take when this column is added to a model already in production, from [DefaultValue] / Default(...). null means none was declared, and a comparison that needs one says so rather than inventing it.

public object? DefaultValue { get; init; }

Property Value

object

Length

The maximum text length (0 = the dialect's default), from [Facet] / Facet(...).

public int Length { get; init; }

Property Value

int

Name

The column name (already through the dialect's naming convention or an explicit override).

public string Name { get; init; }

Property Value

string

Precision

The decimal precision (0 = the dialect's default).

public int Precision { get; init; }

Property Value

int

PreviousNames

The stored names this column used to have, from [PreviousName] / PreviousName(...). A model comparison uses them to recognise a rename instead of reading it as a drop and an add.

public IReadOnlyList<string> PreviousNames { get; init; }

Property Value

IReadOnlyList<string>

Property

The entity property.

public PropertyInfo Property { get; init; }

Property Value

PropertyInfo

Scale

The decimal scale (meaningful when Precision is set).

public int Scale { get; init; }

Property Value

int

StoredType

The stored CLR type — the converter's, or the member's own.

public Type StoredType { get; }

Property Value

Type

Methods

Read(object)

Reads the member from an entity as its stored value.

public object? Read(object entity)

Parameters

entity object

Returns

object

Store(object?)

Converts a value that is about to bind against this column into its stored form.

public object? Store(object? value)

Parameters

value object

Returns

object