Class StructuredRecord
A single row-like record stored by an IStructuredStore: an optional store-assigned identity and a named set of typed field values.
Inherited Members
Namespace: Serenity.Persistence.Domain.ValueObjects
Assembly: Serenity.Global.Domain.dll
Syntax
public sealed class StructuredRecord
Constructors
StructuredRecord(string, IReadOnlyDictionary<string, StructuredValue>)
Creates a new StructuredRecord, defensively copying fields.
Declaration
public StructuredRecord(string id, IReadOnlyDictionary<string, StructuredValue> fields)
Parameters
| Type | Name | Description |
|---|---|---|
| string | id | The store-assigned identity, or |
| IReadOnlyDictionary<string, StructuredValue> | fields | The record's field values. A |
Properties
Fields
The record's field values, keyed by field name.
Declaration
public IReadOnlyDictionary<string, StructuredValue> Fields { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyDictionary<string, StructuredValue> |
Id
The store-assigned identity of this record, or null when not yet persisted or not applicable.
Declaration
public string Id { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
GetValueOrNull(string)
Gets the value of field, or Null when the field is absent.
Declaration
public StructuredValue GetValueOrNull(string field)
Parameters
| Type | Name | Description |
|---|---|---|
| string | field |
Returns
| Type | Description |
|---|---|
| StructuredValue |
ToString()
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |
Overrides
WithId(string)
Creates a copy of this record with a different identity, keeping the same fields.
Declaration
public StructuredRecord WithId(string id)
Parameters
| Type | Name | Description |
|---|---|---|
| string | id |
Returns
| Type | Description |
|---|---|
| StructuredRecord |