Add transaction support between services
This commit is contained in:
@ -5,13 +5,12 @@ using Hcs.WebApp.Services;
|
||||
|
||||
namespace Hcs.WebApp.BackgroundServices.OperationExecutors.NsiCommon
|
||||
{
|
||||
public class ExportNsiItemExecutor_15_7_0_1(IClient client, IServiceScopeFactory scopeFactory, Operation operation) : ExecutorBase(client, scopeFactory, operation)
|
||||
public class ExportNsiItemExecutor_15_7_0_1(IClient client, IServiceScope scope, Operation operation) : ExecutorBase(client, scope, operation)
|
||||
{
|
||||
public override async Task<string> ExecuteAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
using var scope = scopeFactory.CreateScope();
|
||||
var registryService = scope.ServiceProvider.GetRequiredService<RegistryService>();
|
||||
var registry = await registryService.GetRegistryByOperationId(operation.Id);
|
||||
var registry = await registryService.GetRegistryByOperationIdAsync(operation.Id);
|
||||
return await client.NsiCommon.RequestExportNsiItemAsync(registry.Number, ListGroup.NSI, cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user