Class RedbListItem

Assembly: redb.Core.dll

REDB list item entity with direct data storage.
Maps to _list_items table in PostgreSQL.

public class RedbListItem : IRedbListItem

Inheritance

ObjectRedbListItem

Implements

Properties

Alias

Item alias (display name).

[JsonPropertyName("alias")]
public string? Alias { get; set; }

Id

Unique item identifier.

[JsonPropertyName("id")]
public long Id { get; set; }

IdList

List identifier this item belongs to.

[JsonPropertyName("id_list")]
public long IdList { get; set; }

IdObject

Linked object identifier (optional).

[JsonPropertyName("id_object")]
public long? IdObject { get; set; }

IsObjectLoaderAvailable

Check if global loader is available.

public static bool IsObjectLoaderAvailable { get; }

IsObjectReference

Check if item is object reference.

[JsonIgnore]
public bool IsObjectReference { get; }

Object

Linked object with lazy loading.

[JsonPropertyName("object")]
public IRedbObject? Object { get; set; }

Value

Item value.

[JsonPropertyName("value")]
public string Value { get; set; }

Methods

ForList(IRedbList, string?, string?, IRedbObject)

Create ListItem with linked object.

public static RedbListItem ForList(IRedbList list, string? value, string? alias, IRedbObject linkedObject)

ForList(IRedbList, string?, string?, long?)

Create ListItem for specific list.

public static RedbListItem ForList(IRedbList list, string? value, string? alias = null, long? idObject = null)

GetDisplayValue()

Get display value.

public string GetDisplayValue()

SetGlobalObjectLoader(Func<long, Task<IRedbObject?>>)

Set global object loader for all ListItems.

public static void SetGlobalObjectLoader(Func<long, Task<IRedbObject?>> loader)

ToString()

Returns a string that represents the current object.

public override string ToString()

Constructors

RedbListItem()

Default constructor for deserialization and mapping.

RedbListItem(IRedbList, string?, string?, IRedbObject)

Constructor for creating item with linked object.

RedbListItem(IRedbList, string?, string?, long?)

Constructor for creating item linked to list.