< Summary

Information
Class: Elsa.Extensions.WorkflowExecutionLogRecordQueryableExtensions
Assembly: Elsa.Workflows.Runtime
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Extensions/WorkflowExecutionLogRecordQueryableExtensions.cs
Line coverage
100%
Covered lines: 1
Uncovered lines: 0
Coverable lines: 1
Total lines: 25
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
OrderByTimestampThenSequence(...)100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Extensions/WorkflowExecutionLogRecordQueryableExtensions.cs

#LineLine coverage
 1using Elsa.Workflows.Runtime;
 2using Elsa.Workflows.Runtime.Entities;
 3
 4// ReSharper disable once CheckNamespace
 5namespace Elsa.Extensions;
 6
 7/// <summary>
 8/// Canonical default order for <see cref="IWorkflowExecutionLogStore"/> queries that omit an explicit order.
 9/// </summary>
 10public static class WorkflowExecutionLogRecordQueryableExtensions
 11{
 12    /// <summary>
 13    /// Timestamp ascending, then Sequence ascending, then Id ascending.
 14    /// </summary>
 15    /// <remarks>
 16    /// Preserves EF's historical Timestamp default and uses Sequence as the same-timestamp
 17    /// tiebreaker — the purpose of <see cref="WorkflowExecutionLogRecord.Sequence"/>.
 18    /// Sequence is per execution context, so distinct instances can share Timestamp+Sequence;
 19    /// Id is the unique key that keeps offset pagination stable across Memory and EF.
 20    /// Journal list APIs still pass Sequence-primary order explicitly because Sequence is
 21    /// the instance-monotonic event cursor (<c>ExecutionLogSequence</c>).
 22    /// </remarks>
 23    public static IQueryable<WorkflowExecutionLogRecord> OrderByTimestampThenSequence(this IQueryable<WorkflowExecutionL
 4524        queryable.OrderBy(x => x.Timestamp).ThenBy(x => x.Sequence).ThenBy(x => x.Id);
 25}