Class RedbList

Assembly: redb.Core.dll

REDB list entity with direct data storage (Aggregate Root).
Maps to _lists table in PostgreSQL.

public class RedbList : IRedbList

Inheritance

ObjectRedbList

Implements

Properties

Alias

List alias (short name).

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

Id

Unique list identifier.

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

Items

Collection of list items (read-only).

[JsonIgnore]
public IReadOnlyCollection<IRedbListItem> Items { get; }

Name

List name.

[JsonPropertyName("name")]
public string Name { get; set; }

this[string]

Indexer to access list items by value.

public IRedbListItem? this[string value] { get; }

Methods

AddItem(string, IRedbObject, string?)

Add item with linked object (Aggregate Root pattern).

public IRedbListItem AddItem(string value, IRedbObject linkedObject, string? alias = null)

AddItem(string, long?, string?)

Add item to list (Aggregate Root pattern).

public IRedbListItem AddItem(string value, long? idObject = null, string? alias = null)

ClearItems()

Clear items collection.

public void ClearItems()

Create(string, string?)

Create new list.

public static RedbList Create(string name, string? alias = null)

CreateItem(string, IRedbObject, string?)

Create item with linked object.

public IRedbListItem CreateItem(string value, IRedbObject linkedObject, string? alias = null)

CreateItem(string, long?, string?)

Create item without adding to collection.

public IRedbListItem CreateItem(string value, long? idObject = null, string? alias = null)

FindItemByValue(string)

Find item by value.

public IRedbListItem? FindItemByValue(string value)

RemoveItem(IRedbListItem)

Remove item from list.

public bool RemoveItem(IRedbListItem item)

SetItems(IEnumerable<RedbListItem>)

Set items collection (for mapping).

public void SetItems(IEnumerable<RedbListItem> items)

ToString()

Returns a string that represents the current object.

public override string ToString()

Constructors

RedbList()

Default constructor for deserialization and mapping.

RedbList(string, string?)

Constructor with name.