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
Remarks
Creates a new instance of DashboardService.
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 | Service for accessing reflection. |
IAppErrorService | appErrorService | Service for logging application errors. |
IStructureService | structureService | Service for accessing the user's site structure. |
IDashboardPanelStore | panelStore | Store for accessing user dashboard panels. |
IDashboardWidgetStore | widgetStore | Store for accessing dashboard widgets. |
IServiceProvider | serviceProvider | Provider for accessing application services. |
Remarks
Creates a new instance of DashboardService.
Methods
GetAllWidgetsAsync(CancellationToken)
Retrieves all available widgets asynchronously.
Declaration
public Task<IEnumerable<Widget>> GetAllWidgetsAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IEnumerable<Widget>> | Returns a Task<TResult> representing the collection of all available widgets. |
GetUserPanelAsync(IUser, CancellationToken)
Get user panel asynchronously.
Declaration
public Task<Panel> GetUserPanelAsync(IUser user, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IUser | user | The IUser object representing the user. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Panel> | Returns a Task<TResult> representing the user panel. |
GetUserWidgetsAsync(IUser, CancellationToken)
Retrieves widgets accessible to the specified user asynchronously.
Declaration
public Task<IEnumerable<Widget>> GetUserWidgetsAsync(IUser user, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IUser | user | The IUser object representing the user. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IEnumerable<Widget>> | Returns a Task<TResult> representing the collection of widgets accessible to the user. |
InitUserPanelAsync(IUser, CancellationToken)
Initializes a new user panel with default widgets asynchronously.
Declaration
public Task<Panel> InitUserPanelAsync(IUser user, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IUser | user | The IUser object representing the user. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Panel> | Returns a Task<TResult> representing the initialized user panel. |
SavePanelAsync(Panel)
Saves a user panel asynchronously.
Declaration
public Task SavePanelAsync(Panel panel)
Parameters
Type | Name | Description |
---|---|---|
Panel | panel | The Panel object representing the user panel to be saved. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous save operation. |