Class ListProviderBase
Base class for IListProvider implementations.
Contains all business logic for list and list item operations with caching.
SQL queries are abstracted via ISqlDialect.
public abstract class ListProviderBase : IListProvider
Inheritance
Implements
Derived
Properties
LinkedObjectsBatchLoader
Resolves many linked objects in one round-trip on the owning service's connection, for the hand-out preload
public Func<IReadOnlyCollection<long>, CancellationToken, Task<IReadOnlyDictionary<long, IRedbObject>>>? LinkedObjectsBatchLoader { get; set; }
Methods
AddItemsAsync(IRedbList, IEnumerable<IRedbListItem>, CancellationToken)
Add multiple items from ready objects.
public Task<List<RedbListItem>> AddItemsAsync(IRedbList list, IEnumerable<IRedbListItem> items, CancellationToken cancellationToken = default)
AddItemsAsync(IRedbList, IEnumerable<IRedbListItem>)
Add multiple items from ready objects.
public Task<List<RedbListItem>> AddItemsAsync(IRedbList list, IEnumerable<IRedbListItem> items)
AddItemsAsync(IRedbList, IEnumerable<string>, IEnumerable<string>?, CancellationToken)
Add multiple items from string values (convenience method).
public Task<List<RedbListItem>> AddItemsAsync(IRedbList list, IEnumerable<string> values, IEnumerable<string>? aliases = null, CancellationToken cancellationToken = default)
AddItemsAsync(IRedbList, IEnumerable<string>, IEnumerable<string>?)
Add multiple items from string values (convenience method).
public Task<List<RedbListItem>> AddItemsAsync(IRedbList list, IEnumerable<string> values, IEnumerable<string>? aliases = null)
Attach(List<RedbListItem>)
Binds the items to this provider's database, and a not-shared item to this scope as its origin, before they leave
protected List<RedbListItem> Attach(List<RedbListItem> items)
Attach(RedbListItem?)
Binds the items to this provider's database, and a not-shared item to this scope as its origin, before they leave
protected RedbListItem? Attach(RedbListItem? item)
DeleteListAsync(long, CancellationToken)
public Task<bool> DeleteListAsync(long listId, CancellationToken cancellationToken = default)
DeleteListAsync(long)
public Task<bool> DeleteListAsync(long listId)
DeleteListItemAsync(long, CancellationToken)
public Task<bool> DeleteListItemAsync(long itemId, CancellationToken cancellationToken = default)
DeleteListItemAsync(long)
public Task<bool> DeleteListItemAsync(long itemId)
GetAllListsAsync()
public Task<List<RedbList>> GetAllListsAsync()
GetAllListsAsync(CancellationToken)
public Task<List<RedbList>> GetAllListsAsync(CancellationToken cancellationToken = default)
GetItemsByObjectReferenceAsync(long, CancellationToken)
public Task<List<RedbListItem>> GetItemsByObjectReferenceAsync(long objectId, CancellationToken cancellationToken = default)
GetItemsByObjectReferenceAsync(long)
public Task<List<RedbListItem>> GetItemsByObjectReferenceAsync(long objectId)
GetListAsync(long, CancellationToken)
public Task<RedbList?> GetListAsync(long listId, CancellationToken cancellationToken = default)
GetListAsync(long)
public Task<RedbList?> GetListAsync(long listId)
GetListByNameAsync(string, CancellationToken)
public Task<RedbList?> GetListByNameAsync(string name, CancellationToken cancellationToken = default)
GetListByNameAsync(string)
public Task<RedbList?> GetListByNameAsync(string name)
GetListByNameWithItemsAsync(string, CancellationToken)
Get list by name with all its items loaded.
public Task<RedbList?> GetListByNameWithItemsAsync(string name, CancellationToken cancellationToken = default)
GetListByNameWithItemsAsync(string)
Get list by name with all its items loaded.
public Task<RedbList?> GetListByNameWithItemsAsync(string name)
GetListItemAsync(long, CancellationToken)
public Task<RedbListItem?> GetListItemAsync(long itemId, CancellationToken cancellationToken = default)
GetListItemAsync(long)
public Task<RedbListItem?> GetListItemAsync(long itemId)
GetListItemByValueAsync(long, string, CancellationToken)
public Task<RedbListItem?> GetListItemByValueAsync(long listId, string value, CancellationToken cancellationToken = default)
GetListItemByValueAsync(long, string)
public Task<RedbListItem?> GetListItemByValueAsync(long listId, string value)
GetListItemsAsync(long, CancellationToken)
public Task<List<RedbListItem>> GetListItemsAsync(long listId, CancellationToken cancellationToken = default)
GetListItemsAsync(long)
public Task<List<RedbListItem>> GetListItemsAsync(long listId)
GetListItemsByIdsAsync(IEnumerable<long>, CancellationToken)
The list items of the given ids, in one query for those the cache does not hold. An id that names no item is
public Task<List<RedbListItem>> GetListItemsByIdsAsync(IEnumerable<long> itemIds, CancellationToken cancellationToken = default)
GetListWithItemsAsync(long, CancellationToken)
Get list with all its items loaded.
public Task<RedbList?> GetListWithItemsAsync(long listId, CancellationToken cancellationToken = default)
GetListWithItemsAsync(long)
Get list with all its items loaded.
public Task<RedbList?> GetListWithItemsAsync(long listId)
IsListUsedInStructuresAsync(long, CancellationToken)
public Task<bool> IsListUsedInStructuresAsync(long listId, CancellationToken cancellationToken = default)
IsListUsedInStructuresAsync(long)
public Task<bool> IsListUsedInStructuresAsync(long listId)
SaveListAsync(IRedbList, CancellationToken)
public Task<RedbList> SaveListAsync(IRedbList list, CancellationToken cancellationToken = default)
SaveListAsync(IRedbList)
public Task<RedbList> SaveListAsync(IRedbList list)
SaveListItemAsync(IRedbListItem, CancellationToken)
public Task<RedbListItem> SaveListItemAsync(IRedbListItem item, CancellationToken cancellationToken = default)
SaveListItemAsync(IRedbListItem)
public Task<RedbListItem> SaveListItemAsync(IRedbListItem item)
SaveListWithItemsAsync(IRedbList, CancellationToken)
Save list with all its items (Aggregate Root).
public Task<RedbList> SaveListWithItemsAsync(IRedbList list, CancellationToken cancellationToken = default)
SaveListWithItemsAsync(IRedbList)
Save list with all its items (Aggregate Root).
public Task<RedbList> SaveListWithItemsAsync(IRedbList list)
SyncListFromEnumAsync<TEnum>(string?, CancellationToken)
public Task<RedbList> SyncListFromEnumAsync<TEnum>(string? listName = null, CancellationToken cancellationToken = default) where TEnum : struct, Enum
SyncListFromEnumAsync<TEnum>(string?)
public Task<RedbList> SyncListFromEnumAsync<TEnum>(string? listName = null) where TEnum : struct, Enum