Class RedbObject

Assembly: redb.Core.dll

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

ObjectRedbObject

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; }

DateCreate

Object creation date and time

[JsonIgnore]
public DateTimeOffset DateCreate { get; set; }

DateModify

Object last modification date and time

[JsonIgnore]
public DateTimeOffset DateModify { get; set; }

hash

public Guid? hash { get; set; }

Hash

MD5 hash of object for integrity control

[JsonIgnore]
public Guid? Hash { get; set; }

HasParent

Checks if object has a parent

[JsonIgnore]
public bool HasParent { get; }

id

public long id { get; set; }

Id

Unique object identifier

[JsonIgnore]
public long Id { get; set; }

IsProviderAvailable

Check if scheme provider is available

public static bool IsProviderAvailable { get; }

IsRoot

Checks if object is root (has no parent)

[JsonIgnore]
public bool IsRoot { get; }

key

public long? key { get; set; }

Key

Object key field

[JsonIgnore]
public long? Key { get; set; }

name

public string? name { get; set; }

Name

Object name

[JsonIgnore]
public string Name { get; set; }

note

public string? note { get; set; }

Note

Object notes

[JsonIgnore]
public string? Note { get; set; }

owner_id

public long owner_id { get; set; }

OwnerId

Object owner identifier

[JsonIgnore]
public long OwnerId { get; set; }

parent_id

public long? parent_id { get; set; }

ParentId

Parent object identifier

[JsonIgnore]
public long? ParentId { get; set; }

scheme_id

public long scheme_id { get; set; }

SchemeId

Object scheme identifier

[JsonIgnore]
public long SchemeId { 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

public string? value_string { 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; }

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

ComputeHash()

Compute MD5 hash without modifying the hash field.

public virtual Guid ComputeHash()

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()

InvalidateSchemeCache()

Invalidate cache of this object's scheme

public void InvalidateSchemeCache()

RecomputeHash()

Recompute MD5 hash and store in hash field.

public virtual void RecomputeHash()

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)