diff --git a/src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowTypeController.cs b/src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowTypeController.cs index f557944af70..1c6096d3ede 100644 --- a/src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowTypeController.cs +++ b/src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowTypeController.cs @@ -121,7 +121,8 @@ public async Task Index(WorkflowTypeIndexOptions options, PagerPa .Take(pager.PageSize) .ListAsync(); - using var connection = await _session.CreateConnectionAsync(); + // The existing session's connection is returned, don't dispose it + var connection = await _session.CreateConnectionAsync(); var dialect = _session.Store.Configuration.SqlDialect; var sqlBuilder = dialect.CreateBuilder(_session.Store.Configuration.TablePrefix);