Class ResourceHostedService
Background service for initializing cached resources from the localization service at startup.
Implements
Inherited Members
Namespace: DataWeb.Localization
Assembly: DataWeb.Core.dll
Syntax
public sealed class ResourceHostedService : IHostedService
Remarks
Initializes a new instance of the ResourceHostedService class.
Constructors
ResourceHostedService(IServiceProvider)
Background service for initializing cached resources from the localization service at startup.
Declaration
public ResourceHostedService(IServiceProvider serviceProvider)
Parameters
Type | Name | Description |
---|---|---|
IServiceProvider | serviceProvider | The IServiceProvider instance used for resolving services. |
Remarks
Initializes a new instance of the ResourceHostedService class.
Methods
StartAsync(CancellationToken)
Starts the initialization of cached resources from the localization service.
Declaration
public Task StartAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
StopAsync(CancellationToken)
Stops the background service.
Declaration
public Task StopAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |