Files
Evergreen-Health/Evergreen.Health.Application/Health/Integrations/Ib43/Ib43ReportSink.cs
T
2026-11-11 16:11:41 +08:00

17 lines
663 B
C#

namespace Evergreen.Health.Application.Health.Integrations.Ib43;
public interface IIb43ReportSink
{
Task<Ib43SavedReport> SaveAsync(string reportId, Ib43Binding binding, Ib43Report report, CancellationToken token);
}
public sealed class Ib43ReportSink(IServiceScopeFactory scopes) : IIb43ReportSink
{
public async Task<Ib43SavedReport> SaveAsync(string reportId, Ib43Binding binding, Ib43Report report, CancellationToken token)
{
token.ThrowIfCancellationRequested();
using var scope = scopes.CreateScope();
return await scope.ServiceProvider.GetRequiredService<Ib43DataRepository>().Save(reportId, binding, report);
}
}