Interface IDataCollectionDataSource<TItem>
- Namespace
- BlazOrbit.Components
- Assembly
- BlazOrbit.dll
Strategy that materialises the rows shown by a data-collection component
(BOBDataGrid, BOBDataCards). Built-in implementations:
-
InMemoryDataSource<TItem> wraps an in-process
System.Collections.Generic.IEnumerable<T> and runs the filter / sort / page pipeline
locally — the default, backwards-compatible path that mirrors the legacy
Itemsparameter. - RemoteDataSource<TItem> delegates each page request to a user-supplied async provider — typical for server-side paging where the database resolves filters / sorts and returns the matching slice plus the total count.
public interface IDataCollectionDataSource<TItem>
Type Parameters
TItemRow item type.
Methods
LoadAsync(DataRequest, CancellationToken)
Loads the slice described by request. Implementations honour
the page / page size, global filter, per-column filters and sort descriptors,
and return both the materialised page and the total row count after filtering
(the host component uses the total to compute pagination — the slice itself
only contains the visible page).
Task<DataResult<TItem>> LoadAsync(DataRequest request, CancellationToken cancellationToken = default)
Parameters
requestDataRequestUser intent describing the desired slice.
cancellationTokenCancellationTokenToken raised when a newer LoadAsync(DataRequest, CancellationToken) call supersedes this one (typing fast in a column filter, rapid pagination clicks). Long-running implementations should observe the token to avoid leaking work after the host component has moved on.
Returns
- Task<DataResult<TItem>>
Page slice plus total filtered row count.