SQL Server · Types · Entities and values
ArxRecordId
Definition
- Namespace
ARX.SDK.Services- Package
ARX.SDK
public sealed class ArxRecordId : IEquatable<ArxRecordId>The id of one record: the value of its table's id column, of any declared id type. Returned by Create and set on RecordId. None for a table declared NoIdColumn. Immutable; equal when the column and value are equal.
Constructor
No public constructor: create one with:
implicit operator ArxRecordId(long value)An id given as its value alone, so
service.RetrieveAsync("account", 42L)works throughIArxDataServicetoo: the service takes the column from the table's declaration. ItsColumnis empty; useOfto name it.Parameter Type Description valuelongThe id's value. implicit operator ArxRecordId(int value)An int id given as its value alone (see the
longconversion).Parameter Type Description valueintThe id's value. implicit operator ArxRecordId(Guid value)A Guid id given as its value alone (see the
longconversion).Parameter Type Description valueGuidThe id's value. implicit operator ArxRecordId?(string? value)A text id given as its value alone (see the
longconversion); null stays null.Parameter Type Description valuestring?The id's value. ArxRecordId.Of(string column, object value)An id with its column and value, for example to update or delete by id.
Parameter Type Description columnstringThe id column's name. valueobjectThe id's value.
Properties
static ArxRecordId None { get; }No id: what Create returns for a table declared
NoIdColumn.string Column { get; }The id column's name. Empty for
None, and for an id given as its value alone.bool HasValue { get; }False for
None.object Value { get; }The id's value, in the declared type.
Methods
long AsInt64()The value of an integer id (short, int or long).
int AsInt32()The value of an integer id as an int.
Guid AsGuid()The value of a Guid id.
string AsString()The value of a string id.
bool Equals(ArxRecordId? other)True when
otherhas an equal value (integers compare by value, whatever their width) and the same id column when both name one, so an id given as a plain value equals the id Create returned. Two ids without a value are equal.Parameter Type Description otherArxRecordId?The id to compare with, or null. static bool operator ==(ArxRecordId? left, ArxRecordId? right)True when the ids are equal (see
Equals); two nulls are equal.Parameter Type Description leftArxRecordId?An id, or null. rightArxRecordId?An id, or null. static bool operator !=(ArxRecordId? left, ArxRecordId? right)True when the ids differ.
Parameter Type Description leftArxRecordId?An id, or null. rightArxRecordId?An id, or null.
Usage
A line from a verified sample; the full, runnable code is on its page.
ArxRecordId id = await service.CreateAsync(entity);Create one record and get its id, scenario 1
Used in:
- Create one record and get its idCreate
- Create a record that points at another oneCreate
- Ids that aren't numbers: text and uuidCreate
- Create without a catalogCreate
- Every supported .NET type, and what SQL Server storesCreate
- Instants, local times, dates and times of dayCreate
- Picklist values checked against the application's catalogCreate
- Register ARX in a DI container and inject itCreate
- Write to two databases, each with its own serviceCreate
- A security check around creates: log, block, handle false positivesCreate
- Set the service up for productionCreate
- Use columns named outside the name rule, through aliasesCreate
- Log every call through ILoggerCreate
- Create many records in one call and get their idsCreateMultiple
- Create many records without a catalogCreateMultiple
- Import a 20,000-item product feed in one callCreateMultiple
- Import 5,000 contacts in batches, in one transactionCreateMultiple
- An order and its lines: all steps or noneCreateMultiple
- Update one recordUpdate
- Clear a value, keep the othersUpdate
- Update without a catalogUpdate
- An edit form changes some account detailsUpdate
- Turn update errors into messagesUpdate
- Catch an SQL injection attempt on updateUpdate
- Updates in one ARX transaction: commit, roll back, abortUpdate
- Create an order and update the stock, all or nothingUpdate
- A security check around updates: batches, allowed fields, false positivesUpdate
- Update many records in one callUpdateMultiple
- Delete one recordDelete
- Delete without a catalogDelete
- Remove a contact by id or by emailDelete
- A referenced record: ARX3002, then delete in orderDelete
- Catch an SQL injection attempt on deleteDelete
- Replace an order's lines: delete, create, update, all or nothingDelete
- A security check around deletes: probing, blocking, unblocking a false positiveDelete
- Delete many records in one callDeleteMultiple
- Remove the contacts a user selectedDeleteMultiple
- Deletes in one ARX transaction: roll back or commitDeleteMultiple
- Retrieve one recordRetrieve
- Choose the columns to readRetrieve
- Find a record by id, key or columnsRetrieve
- Retrieve without a catalogRetrieve
- Read a viewRetrieveMultiple
- Read a function that returns a tableRetrieveMultiple
- Lookups and display namesRetrieveMultiple
- Read in a batch scopeRetrieveMultiple
- Filter expressions in depth: nesting, recursion, links, And and OrRetrieveMultiple
- Link entities in depth: chains, branches, criteria per level, recursionRetrieveMultiple
- Read other row sources: a view in a schema, a summary view, a table with no idRetrieveMultiple
- Read functions in depth: table rows, one row, scalar values, what functions don't take, proceduresRetrieveMultiple
- Views in depth: computed criteria, links both ways, declared ids and lookups, column boundariesRetrieveMultiple
- Call a stored procedureExecute
- Read OUT and INOUT valuesExecute
- Call a function: a value, rows, an effectExecute
- Place an order through a procedureExecute
- A report with several result setsExecute
- Business errors raised by a procedureExecute
- Catch an SQL injection attempt on ExecuteExecute
- Execute in a batch scope: a refused call undone aloneExecute
- A security check around Execute: probing, blocking, unblocking a false positiveExecute