Class DashboardService
Dashboard service for managing user dashboards and widgets.
Implements
Inherited Members
Namespace: DataWeb.Dashboard
Assembly: DataWeb.Core.dll
Syntax
public class DashboardService : IDashboardService
Constructors
DashboardService(IReflectionService, IAppErrorService, IStructureService, IDashboardPanelStore, IDashboardWidgetStore, IServiceProvider)
Dashboard service for managing user dashboards and widgets.
Declaration
public DashboardService(IReflectionService reflectionService, IAppErrorService appErrorService, IStructureService structureService, IDashboardPanelStore panelStore, IDashboardWidgetStore widgetStore, IServiceProvider serviceProvider)
Parameters
| Type | Name | Description |
|---|---|---|
| IReflectionService | reflectionService | |
| IAppErrorService | appErrorService | |
| IStructureService | structureService | |
| IDashboardPanelStore | panelStore | |
| IDashboardWidgetStore | widgetStore | |
| IServiceProvider | serviceProvider |
Methods
GetAllWidgetsAsync(CancellationToken)
Retrieves all available dashboard widgets asynchronously.
Declaration
public Task<IEnumerable<DashboardWidget>> GetAllWidgetsAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | A cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<DashboardWidget>> | A Task<TResult> representing the collection of all available widgets. |
GetUserPanelAsync(IUser, CancellationToken)
Retrieves the user's dashboard panel asynchronously.
Declaration
public Task<DashboardPanel> GetUserPanelAsync(IUser user, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IUser | user | The IUser object representing the user. |
| CancellationToken | cancellationToken | A cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<DashboardPanel> | A Task<TResult> representing the user's dashboard panel, or null if not found. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when |
GetUserWidgetsAsync(IUser, CancellationToken)
Retrieves widgets accessible to the specified user asynchronously.
Declaration
public Task<IEnumerable<DashboardWidget>> GetUserWidgetsAsync(IUser user, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IUser | user | The IUser object representing the user. |
| CancellationToken | cancellationToken | A cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<DashboardWidget>> | A Task<TResult> representing the collection of widgets accessible to the user. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when |
InitUserPanelAsync(IUser, CancellationToken)
Initializes a new user panel with default widgets asynchronously.
Declaration
public Task<DashboardPanel> InitUserPanelAsync(IUser user, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IUser | user | The IUser object representing the user. |
| CancellationToken | cancellationToken | A cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<DashboardPanel> | A Task<TResult> representing the initialized user panel. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when |
SavePanelAsync(DashboardPanel)
Saves a user panel asynchronously.
Declaration
public Task SavePanelAsync(DashboardPanel panel)
Parameters
| Type | Name | Description |
|---|---|---|
| DashboardPanel | panel | The DashboardPanel object representing the user panel to be saved. |
Returns
| Type | Description |
|---|---|
| Task | A Task representing the asynchronous save operation. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when |