MySQL · Types · The schema catalog

ArxSelectionSetDefinition

Definition

Namespace
ARX.SDK.Services
Package
ARX.SDK
C#
public sealed class ArxSelectionSetDefinition

One selection set: its kind, storage form and options. Immutable and thread-safe. Validates selection set values and converts them to and from the stored form, so every provider applies the same rules.

Constructor

  • ArxSelectionSetDefinition(string name, ArxSelectionSetKind kind, IEnumerable<ArxSelectionSetOption> options, ArxSelectionSetMultiplicity multiplicity = ArxSelectionSetMultiplicity.Single, string? databaseTypeName = null, string delimiter = ",")

    A selection set and its options, checked for consistency.

    Parameter Type Description
    namestringThe name selection set values refer to.
    kindArxSelectionSetKindWhat the codes are, matching the column.
    optionsIEnumerable<ArxSelectionSetOption>Each code with its display text, order and whether it is still active.
    multiplicityArxSelectionSetMultiplicity= ArxSelectionSetMultiplicity.SingleOne code (Single), or several and how they are stored.
    databaseTypeNamestring?= nullThe PostgreSQL enum type, for a DatabaseEnum set.
    delimiterstring= ","The separator of a Delimited set.

Properties

  • string Name { get; }

    The name selection set values refer to.

  • ArxSelectionSetKind Kind { get; }

    What the codes are, matching the column that stores them.

  • ArxSelectionSetMultiplicity Multiplicity { get; }

    One code, or several and in which storage form.

  • string? DatabaseTypeName { get; }

    The database enum type a DatabaseEnum set casts to (for example "mood"). The provider validates and quotes it.

  • string Delimiter { get; }

    The separator of a Delimited set.

  • IReadOnlyList<ArxSelectionSetOption> Options { get; }

    The options, by Order (stable for equal orders).

  • Type CodeType { get; }

    The CLR type of every code, taken from the options. Single values and array elements are written as this type.

Methods

  • bool TryGetOption(object code, out ArxSelectionSetOption option)

    Finds the option with this code. A code of another kind (a string for an Integer set) isn't found.

    Parameter Type Description
    codeobjectThe option's code.
    optionout ArxSelectionSetOptionThe option when found; otherwise null.
  • object ToStoredValue(ArxSelectionSetValue value, string? entityName = null, string? attributeName = null, string? provider = null)

    Validates value against this set and returns what the provider writes: the option's own code (Single), a typed array (Array), the OR of the codes (Flags), the joined codes (Delimited) or an ArxJsonB array (Json). Multiple-choice forms list the options in set order.

    Parameter Type Description
    valueArxSelectionSetValueThe value to write.
    entityNamestring?= nullThe table, for the error message.
    attributeNamestring?= nullThe column, for the error message.
    providerstring?= nullThe provider's name, for the error.
  • ArxSelectionSetValue? FromStoredValue(object? stored)

    Decodes a stored column value back into an ArxSelectionSetValue with its matched options. A stored code that isn't in the set is kept, with a null option (IsDefined false); reading never fails because of data that predates the catalog. Null gives null.

    Parameter Type Description
    storedobject?The value read from the column.

Usage

C#

A line from the sample application's files.

.Add(new ArxSelectionSetDefinition("CustomerSegment", ArxSelectionSetKind.String, new[]

SampleCatalog.cs, in the sample application

Used in: