feat(transport): add IAuditCorrelationContext scoped service
This commit is contained in:
@@ -4,6 +4,7 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
using ScadaLink.Commons.Interfaces;
|
||||
using ScadaLink.Commons.Interfaces.Repositories;
|
||||
using ScadaLink.Commons.Interfaces.Services;
|
||||
using ScadaLink.Commons.Interfaces.Transport;
|
||||
using ScadaLink.ConfigurationDatabase.Maintenance;
|
||||
using ScadaLink.ConfigurationDatabase.Repositories;
|
||||
using ScadaLink.ConfigurationDatabase.Services;
|
||||
@@ -51,6 +52,7 @@ public static class ServiceCollectionExtensions
|
||||
services.AddScoped<IAuditLogRepository, AuditLogRepository>();
|
||||
services.AddScoped<ISiteCallAuditRepository, SiteCallAuditRepository>();
|
||||
services.AddScoped<IInboundApiRepository, InboundApiRepository>();
|
||||
services.AddScoped<IAuditCorrelationContext, AuditCorrelationContext>();
|
||||
services.AddScoped<IAuditService, AuditService>();
|
||||
services.AddScoped<IInstanceLocator, InstanceLocator>();
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
using ScadaLink.Commons.Interfaces.Transport;
|
||||
|
||||
namespace ScadaLink.ConfigurationDatabase.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Per-scope mutable holder for the active bundle import id. AuditService reads it
|
||||
/// while writing AuditLogEntry rows. Registered as Scoped so each Blazor circuit /
|
||||
/// request gets its own value; ApplyAsync explicitly creates a service scope and
|
||||
/// sets the id at the top of the transaction.
|
||||
/// </summary>
|
||||
public sealed class AuditCorrelationContext : IAuditCorrelationContext
|
||||
{
|
||||
public Guid? BundleImportId { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user