diff --git a/backend/Tnsu.ApprovalRoute.Application/Reports/RouteExportService.cs b/backend/Tnsu.ApprovalRoute.Application/Reports/RouteExportService.cs index 4bb1d5c..a8f04ff 100644 --- a/backend/Tnsu.ApprovalRoute.Application/Reports/RouteExportService.cs +++ b/backend/Tnsu.ApprovalRoute.Application/Reports/RouteExportService.cs @@ -88,6 +88,9 @@ public sealed class RouteExportService( var routes = await db.TemplateRoutes.AsNoTracking() .Where(x => requestTypeIds.Contains(x.RequestTypeId)) .Include(x => x.Steps).ThenInclude(s => s.Conditions) + // Две вложенные коллекции (шаги и их условия) одним запросом дали бы декартово + // произведение строк — режем на отдельные запросы. + .AsSplitQuery() .OrderBy(x => x.Id) .ToListAsync(cancellationToken);