Fix build and code structure improvements. New but essential UI functionality. CI improvements. Documentation improvements. AI module improvements.
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using StellaOps.Infrastructure.Postgres.Options;
|
||||
using StellaOps.VexHub.Core;
|
||||
using StellaOps.VexHub.Persistence.Postgres;
|
||||
using StellaOps.VexHub.Persistence.Postgres.Repositories;
|
||||
|
||||
namespace StellaOps.VexHub.Persistence.Extensions;
|
||||
|
||||
/// <summary>
|
||||
/// Service collection extensions for VexHub persistence.
|
||||
/// </summary>
|
||||
public static class VexHubPersistenceExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds VexHub PostgreSQL persistence services to the service collection.
|
||||
/// </summary>
|
||||
public static IServiceCollection AddVexHubPersistence(
|
||||
this IServiceCollection services,
|
||||
IConfiguration configuration)
|
||||
{
|
||||
services.Configure<PostgresOptions>(configuration.GetSection("Postgres"));
|
||||
|
||||
services.AddSingleton<VexHubDataSource>();
|
||||
services.AddScoped<IVexStatementRepository, PostgresVexStatementRepository>();
|
||||
services.AddScoped<IVexProvenanceRepository, PostgresVexProvenanceRepository>();
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds VexHub PostgreSQL persistence services with explicit options.
|
||||
/// </summary>
|
||||
public static IServiceCollection AddVexHubPersistence(
|
||||
this IServiceCollection services,
|
||||
Action<PostgresOptions> configureOptions)
|
||||
{
|
||||
services.Configure(configureOptions);
|
||||
|
||||
services.AddSingleton<VexHubDataSource>();
|
||||
services.AddScoped<IVexStatementRepository, PostgresVexStatementRepository>();
|
||||
services.AddScoped<IVexProvenanceRepository, PostgresVexProvenanceRepository>();
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user