Alter bookmark expression to include correlation when its needed as 'this.CorrelationId == null' isnt trimmed in YesSql providing incorrect sql (#1634)
Co-authored-by: Matthew Green <Matthew.Green@brightstarr.com>
This commit is contained in:
parent
ab6b2515d0
commit
cdf120dc0e
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Linq.Expressions;
|
||||
using Elsa.Models;
|
||||
|
||||
|
|
@ -16,10 +16,13 @@ namespace Elsa.Persistence.Specifications.Bookmarks
|
|||
public string? TenantId { get; set; }
|
||||
public string? CorrelationId { get; }
|
||||
public string ActivityType { get; set; }
|
||||
|
||||
public override Expression<Func<Bookmark, bool>> ToExpression() => bookmark =>
|
||||
bookmark.TenantId == TenantId &&
|
||||
bookmark.ActivityType == ActivityType &&
|
||||
(CorrelationId == null || bookmark.CorrelationId == CorrelationId);
|
||||
|
||||
public override Expression<Func<Bookmark, bool>> ToExpression() =>
|
||||
CorrelationId == null
|
||||
? bookmark => bookmark.TenantId == TenantId
|
||||
&& bookmark.ActivityType == ActivityType
|
||||
: bookmark => bookmark.TenantId == TenantId
|
||||
&& bookmark.ActivityType == ActivityType
|
||||
&& bookmark.CorrelationId == CorrelationId;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue