using System.Data; using Dapper; namespace PlotLine.Data; public sealed record DeploymentDatabaseHealth(string DatabaseName, bool LedgerReady, bool RuntimeRestricted = true); public interface IDeploymentHealthRepository { Task ReadAsync(CancellationToken cancellationToken); } public sealed class DeploymentHealthRepository(ISqlConnectionFactory connections) : IDeploymentHealthRepository { public async Task ReadAsync(CancellationToken cancellationToken) { using var connection=connections.CreateConnection(); return await connection.QuerySingleAsync(new CommandDefinition( "dbo.Deployment_Health",commandType:CommandType.StoredProcedure, cancellationToken:cancellationToken,commandTimeout:5)); } }