diff --git a/src/providers/WorkflowCore.Persistence.EntityFramework/Services/EntityFrameworkPersistenceProvider.cs b/src/providers/WorkflowCore.Persistence.EntityFramework/Services/EntityFrameworkPersistenceProvider.cs index 44798a0c9..2411d4d57 100644 --- a/src/providers/WorkflowCore.Persistence.EntityFramework/Services/EntityFrameworkPersistenceProvider.cs +++ b/src/providers/WorkflowCore.Persistence.EntityFramework/Services/EntityFrameworkPersistenceProvider.cs @@ -391,16 +391,18 @@ public async Task ProcessCommands(DateTimeOffset asOf, Func() .Where(x => x.ExecuteTime < asOf.UtcDateTime.Ticks) - .AsAsyncEnumerable(); + .AsEnumerable(); - await foreach (var command in cursor) + foreach (var command in cursor) { try { await action(command.ToScheduledCommand()); - using var db2 = ConstructDbContext(); - db2.Set().Remove(command); - await db2.SaveChangesAsync(); + using (var db2 = ConstructDbContext()) + { + db2.Set().Remove(command); + await db2.SaveChangesAsync(); + } } catch (Exception) { diff --git a/src/providers/WorkflowCore.Persistence.EntityFramework/WorkflowCore.Persistence.EntityFramework.csproj b/src/providers/WorkflowCore.Persistence.EntityFramework/WorkflowCore.Persistence.EntityFramework.csproj index bb07fffd3..9441af7a4 100644 --- a/src/providers/WorkflowCore.Persistence.EntityFramework/WorkflowCore.Persistence.EntityFramework.csproj +++ b/src/providers/WorkflowCore.Persistence.EntityFramework/WorkflowCore.Persistence.EntityFramework.csproj @@ -3,7 +3,7 @@ Workflow Core EntityFramework Core Persistence Provider Daniel Gerlag - netstandard2.1;net6.0 + netstandard2.0;net6.0 WorkflowCore.Persistence.EntityFramework WorkflowCore.Persistence.EntityFramework workflow;.NET;Core;state machine;WorkflowCore;EntityFramework;EntityFrameworkCore @@ -25,7 +25,7 @@ - +