Class ResourceHostedService
Background service for initializing cached resources from the localization service at startup.
Inheritance
object
ResourceHostedService
Implements
IHostedService
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: DataWeb.Localization
Assembly: DataWeb.Core.dll
Syntax
public class ResourceHostedService : IHostedService
Constructors
ResourceHostedService(IServiceProvider)
Initializes a new instance of the ResourceHostedService class.
Declaration
public ResourceHostedService(IServiceProvider serviceProvider)
Parameters
Type | Name | Description |
---|---|---|
IServiceProvider | serviceProvider | The System.IServiceProvider instance used for resolving services. |
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 System.Threading.Tasks.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 System.Threading.Tasks.Task representing the asynchronous operation. |
Implements
Microsoft.Extensions.Hosting.IHostedService