Files
ScadaBridge/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Persistence/SiteStorageInitializer.cs
T
Joseph Doherty eabf270d71 docs: complete XML doc coverage (returns, summaries, inheritdoc)
Resolve all 622 issues flagged by the enhanced CommentChecker: add missing
<returns> tags (incl. the standard phrasing on non-generic Task methods),
add missing <summary> tags, and replace misused/redundant <inheritdoc/> on
members that override or implement nothing with real documentation.
Documentation-only — no behavior change; solution builds clean.
2026-06-03 11:39:32 -04:00

39 lines
1.4 KiB
C#

using Microsoft.Extensions.Hosting;
namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Persistence;
/// <summary>
/// Hosted service that initializes the SQLite schema on startup.
/// Runs before the Akka actor system starts creating actors.
/// </summary>
public class SiteStorageInitializer : IHostedService
{
private readonly SiteStorageService _storage;
/// <summary>
/// Initializes a new <see cref="SiteStorageInitializer"/>.
/// </summary>
/// <param name="storage">The site storage service whose schema is initialized on startup.</param>
public SiteStorageInitializer(SiteStorageService storage)
{
_storage = storage;
}
/// <summary>
/// Initializes the SQLite schema before the actor system starts.
/// </summary>
/// <param name="cancellationToken">Cancellation token for the startup operation.</param>
/// <returns>A task that represents the asynchronous operation.</returns>
public async Task StartAsync(CancellationToken cancellationToken)
{
await _storage.InitializeAsync();
}
/// <summary>
/// No-op stop; schema initialization does not require cleanup.
/// </summary>
/// <param name="cancellationToken">Unused cancellation token.</param>
/// <returns>A task that represents the asynchronous operation.</returns>
public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
}