From d45eef33d1b0dfedc1dfcfab763e570b7d6fac19 Mon Sep 17 00:00:00 2001 From: Eugene Andrukh Date: Thu, 23 Jun 2022 16:34:05 +0300 Subject: [PATCH] Support netstandard2.0 in WorkflowCore.Persistence.EntityFramework #1041 --- .../Services/EntityFrameworkPersistenceProvider.cs | 12 +++++++----- .../WorkflowCore.Persistence.EntityFramework.csproj | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) 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 @@ - +