From a1c042ea61a3aae23f48ee016be6ff8857c00bc7 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Sun, 20 Dec 2020 13:42:21 +0100 Subject: [PATCH] Handle WorkflowInstanceIdSpecification explicitly --- .../Stores/YesSqlWorkflowInstanceStore.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/persistence/Elsa.Persistence.YesSql/Stores/YesSqlWorkflowInstanceStore.cs b/src/persistence/Elsa.Persistence.YesSql/Stores/YesSqlWorkflowInstanceStore.cs index 1af2809d7..6a15733c5 100644 --- a/src/persistence/Elsa.Persistence.YesSql/Stores/YesSqlWorkflowInstanceStore.cs +++ b/src/persistence/Elsa.Persistence.YesSql/Stores/YesSqlWorkflowInstanceStore.cs @@ -22,8 +22,9 @@ namespace Elsa.Persistence.YesSql.Stores protected override IQuery MapSpecification(ISpecification specification) => specification switch { - EntityIdSpecification entityIdSpecification => Query(x => x.InstanceId == entityIdSpecification.Id), - BlockingActivityTypeSpecification blockingActivityTypeSpecification => Query(x => x.ActivityType == blockingActivityTypeSpecification.ActivityType), + EntityIdSpecification spec => Query(x => x.InstanceId == spec.Id), + WorkflowInstanceIdSpecification spec => Query(x => x.InstanceId == spec.Id), + BlockingActivityTypeSpecification spec => Query(x => x.ActivityType == spec.ActivityType), _ => AutoMapSpecification(specification) }; @@ -34,13 +35,13 @@ namespace Elsa.Persistence.YesSql.Stores case BlockingActivityTypeSpecification: { var indexedQuery = query.With(); - var expression = orderBy.OrderByExpression.ConvertType(); + var expression = orderBy.OrderByExpression.ConvertType().ConvertType(); return orderBy.SortDirection == SortDirection.Ascending ? indexedQuery.OrderBy(expression) : indexedQuery.OrderByDescending(expression); } default: { var indexedQuery = query.With(); - var expression = orderBy.OrderByExpression.ConvertType(); + var expression = orderBy.OrderByExpression.ConvertType().ConvertType(); return orderBy.SortDirection == SortDirection.Ascending ? indexedQuery.OrderBy(expression) : indexedQuery.OrderByDescending(expression); } }