SQL Server · Types · The schema catalog

ArxIdColumn

Definition

Namespace
ARX.SDK.Services
Package
ARX.SDK
C#
public sealed class ArxIdColumn : IEquatable<ArxIdColumn>

A table's id column, declared by the developer: the one column that identifies a record. Every table declares exactly one, or NoIdColumn when it has no id column.

Constructor

No public constructor: create one with:

  • ArxIdColumn.Generated<T>(string name)

    An id column the database fills in when the entity has no value for it (identity, sequence, default).

    Parameter Type Description
    namestringThe id column's name.
  • ArxIdColumn.Supplied<T>(string name)

    An id column the caller always gives a value for.

    Parameter Type Description
    namestringThe id column's name.

Properties

  • static ArxIdColumn NoIdColumn { get; }

    The table has no id column: a log or a history table, or a table identified only by a combination of columns, such as a compound primary key (declare those columns as a key). Create stores its rows and returns None.

  • static ArxIdColumn NoPrimaryKey { get; }
    Obsolete. Use ArxIdColumn.NoIdColumn: the same declaration under a name that also fits a compound primary key.

    The former name of NoIdColumn: it read as wrong for a table with a compound primary key.

  • string Name { get; }

    The column name (compared with attribute names case-insensitively, like every column). Empty for NoIdColumn.

  • Type Type { get; }

    The .NET type the id is read and written as.

  • bool IsGenerated { get; }

    True when the database can produce the value.

  • bool IsNoIdColumn { get; }

    True for NoIdColumn.

  • bool IsNoPrimaryKey { get; }
    Obsolete. Use IsNoIdColumn.

    The former name of IsNoIdColumn.

  • bool IsInteger { get; }

    True when the id is a short, int or long.

Methods

  • bool Equals(ArxIdColumn? other)

    Equal when both are NoIdColumn, or have the same name (ignoring case), type and generated flag.

    Parameter Type Description
    otherArxIdColumn?The id column to compare with.

Usage

C#

A line from a verified sample; the full, runnable code is on its page.

.Table("account", ArxIdColumn.Generated<long>("id"))

Create one record and get its id, scenario 1

Used in:

Notes

Generated: the database produces the value when the entity doesn't give one (an identity column, a sequence, a default). A value the entity does give is written. Supplied: the caller always gives the value (a natural id such as a country code or a SKU, a client-generated Guid).