Class RedbObject
Base class for all Redb objects with access to metadata.
Contains all fields from _objects table and methods for working with cached metadata.
Can be used directly for Object schemes (without Props) or as base for RedbObject{TProps}.
public class RedbObject : IRedbObject
Inheritance
Implements
Derived
Properties
date_begin
public DateTimeOffset? date_begin { get; set; }
date_complete
public DateTimeOffset? date_complete { get; set; }
date_create
public DateTimeOffset date_create { get; set; }
date_modify
public DateTimeOffset date_modify { get; set; }
DateBegin
Object validity start date (optional)
[JsonIgnore]
public DateTimeOffset? DateBegin { get; set; }
DateComplete
Object validity end date (optional)
[JsonIgnore]
public DateTimeOffset? DateComplete { get; set; }
DateModify
Object last modification date and time
[JsonIgnore]
public DateTimeOffset DateModify { get; set; }
hash
public Guid? hash { get; set; }
id
public long id { get; set; }
IsPropsLoaded
Whether the object's properties are present in memory. A non-generic object has none,
[JsonIgnore]
public virtual bool IsPropsLoaded { get; }
IsProviderAvailable
Check if scheme provider is available
public static bool IsProviderAvailable { get; }
key
public long? key { get; set; }
name
public string? name { get; set; }
note
public string? note { get; set; }
owner_id
public long owner_id { get; set; }
parent_id
public long? parent_id { get; set; }
scheme_id
public long scheme_id { get; set; }
value_bool
public bool? value_bool { get; set; }
value_bytes
public byte[]? value_bytes { get; set; }
value_datetime
public DateTimeOffset? value_datetime { get; set; }
value_double
public double? value_double { get; set; }
value_guid
public Guid? value_guid { get; set; }
value_long
public long? value_long { get; set; }
value_numeric
public decimal? value_numeric { get; set; }
value_string
Identifier / external-key value (RedbPrimitive<string>). Contract limit 450 characters
public string? value_string { get; set; }
value_unique
public string? value_unique { get; set; }
ValueBool
Primitive boolean value (for primitive schemas)
[JsonIgnore]
public bool? ValueBool { get; set; }
ValueBytes
Primitive byte array value (for primitive schemas)
[JsonIgnore]
public byte[]? ValueBytes { get; set; }
ValueDatetime
Primitive datetime value (for primitive schemas)
[JsonIgnore]
public DateTimeOffset? ValueDatetime { get; set; }
ValueDouble
Primitive double value (for primitive schemas)
[JsonIgnore]
public double? ValueDouble { get; set; }
ValueGuid
Primitive GUID value (for primitive schemas)
[JsonIgnore]
public Guid? ValueGuid { get; set; }
ValueLong
Primitive long value (for primitive schemas)
[JsonIgnore]
public long? ValueLong { get; set; }
ValueNumeric
Primitive decimal value (for primitive schemas)
[JsonIgnore]
public decimal? ValueNumeric { get; set; }
ValueString
Primitive string value (for primitive schemas)
[JsonIgnore]
public string? ValueString { get; set; }
ValueUnique
Application-defined unique key of the object within its scheme (V4, UNIQUE stage 1).
[JsonIgnore]
public string? ValueUnique { get; set; }
who_change_id
public long who_change_id { get; set; }
WhoChangeId
Identifier of user who last modified the object
[JsonIgnore]
public long WhoChangeId { get; set; }
Methods
GetSchemeAsync()
Get object scheme by scheme_id (using cache)
public Task<IRedbScheme?> GetSchemeAsync()
GetSchemeSyncProvider()
Get global scheme provider
protected static ISchemeSyncProvider? GetSchemeSyncProvider()
GetStructureByNameAsync(string)
Get structure by field name (using cache)
public Task<IRedbStructure?> GetStructureByNameAsync(string fieldName)
GetStructuresAsync()
Get object scheme structures (using cache)
public Task<IReadOnlyCollection<IRedbStructure>?> GetStructuresAsync()
ResetId(bool)
Reset object ID and optionally ParentId (IRedbObject.ResetId implementation)
public void ResetId(bool withParent = true)
ResetId(long)
public void ResetId(long id)
ResetIds(bool)
Reset object ID and ParentId (base implementation of IRedbObject.ResetIds)
public virtual void ResetIds(bool recursive = false)
SetSchemeSyncProvider(ISchemeSyncProvider)
Set global scheme provider for all objects
public static void SetSchemeSyncProvider(ISchemeSyncProvider provider)
ToString()
The object's canonical JSON - the same contract get_object_json(id) returns and
public override string ToString()
Remarks
The debugger shows the short display string below (the debugger prefers it over
and walks up the hierarchy, so every derived object gets it);
returns the object's canonical JSON (discussion #12, item 2).