17 lines
663 B
C#
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);
|
|
}
|
|
}
|