< Summary

Information
Class: Elsa.Workflows.Runtime.Stores.MemoryWorkflowExecutionLogStore
Assembly: Elsa.Workflows.Runtime
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Stores/MemoryWorkflowExecutionLogStore.cs
Line coverage
36%
Covered lines: 9
Uncovered lines: 16
Coverable lines: 25
Total lines: 90
Line coverage: 36%
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
.ctor(...)100%11100%
AddAsync(...)100%210%
AddManyAsync(...)100%11100%
SaveAsync(...)100%210%
SaveManyAsync(...)100%210%
FindAsync(...)100%210%
FindAsync(...)100%210%
FindManyAsync(...)100%11100%
FindManyAsync(...)100%210%
DeleteManyAsync(...)100%210%
Filter(...)100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Stores/MemoryWorkflowExecutionLogStore.cs

#LineLine coverage
 1using Elsa.Common.Models;
 2using Elsa.Common.Services;
 3using Elsa.Extensions;
 4using Elsa.Workflows.Runtime.Entities;
 5using Elsa.Workflows.Runtime.Filters;
 6using Elsa.Workflows.Runtime.OrderDefinitions;
 7
 8namespace Elsa.Workflows.Runtime.Stores;
 9
 10/// <inheritdoc />
 11public class MemoryWorkflowExecutionLogStore : IWorkflowExecutionLogStore
 12{
 13    private readonly MemoryStore<WorkflowExecutionLogRecord> _store;
 14
 15    /// <summary>
 16    /// Initializes a new instance of the <see cref="MemoryWorkflowExecutionLogStore"/> class.
 17    /// </summary>
 15018    public MemoryWorkflowExecutionLogStore(MemoryStore<WorkflowExecutionLogRecord> store)
 19    {
 15020        _store = store;
 15021    }
 22
 23    /// <inheritdoc />
 24    public Task AddAsync(WorkflowExecutionLogRecord record, CancellationToken cancellationToken = default)
 25    {
 026        _store.Add(record, x => x.Id);
 027        return Task.CompletedTask;
 28    }
 29
 30    /// <inheritdoc />
 31    public Task AddManyAsync(IEnumerable<WorkflowExecutionLogRecord> records, CancellationToken cancellationToken = defa
 32    {
 264033        _store.AddMany(records, x => x.Id);
 14334        return Task.CompletedTask;
 35    }
 36
 37    /// <inheritdoc />
 38    public Task SaveAsync(WorkflowExecutionLogRecord record, CancellationToken cancellationToken = default)
 39    {
 040        _store.Save(record, x => x.Id);
 041        return Task.CompletedTask;
 42    }
 43
 44    /// <inheritdoc />
 45    public Task SaveManyAsync(IEnumerable<WorkflowExecutionLogRecord> records, CancellationToken cancellationToken = def
 46    {
 047        _store.SaveMany(records, x => x.Id);
 048        return Task.CompletedTask;
 49    }
 50
 51    /// <inheritdoc />
 52    public Task<WorkflowExecutionLogRecord?> FindAsync(WorkflowExecutionLogRecordFilter filter, CancellationToken cancel
 53    {
 054        var result = _store.Query(query => Filter(query, filter)).FirstOrDefault();
 055        return Task.FromResult(result);
 56    }
 57
 58    /// <inheritdoc />
 59    public Task<WorkflowExecutionLogRecord?> FindAsync<TOrderBy>(WorkflowExecutionLogRecordFilter filter, WorkflowExecut
 60    {
 061        var result = _store.Query(query => Filter(query, filter).OrderBy(order)).FirstOrDefault();
 062        return Task.FromResult(result);
 63    }
 64
 65    /// <inheritdoc />
 66    public Task<Page<WorkflowExecutionLogRecord>> FindManyAsync(WorkflowExecutionLogRecordFilter filter, PageArgs pageAr
 67    {
 468        var count = _store.Query(query => Filter(query, filter)).LongCount();
 469        var result = _store.Query(query => Filter(query, filter).Paginate(pageArgs)).ToList();
 270        return Task.FromResult(Page.Of(result, count));
 71    }
 72
 73    /// <inheritdoc />
 74    public Task<Page<WorkflowExecutionLogRecord>> FindManyAsync<TOrderBy>(WorkflowExecutionLogRecordFilter filter, PageA
 75    {
 076        var count = _store.Query(query => Filter(query, filter)).LongCount();
 077        var result = _store.Query(query => Filter(query, filter).OrderBy(order).Paginate(pageArgs)).ToList();
 078        return Task.FromResult(Page.Of(result, count));
 79    }
 80
 81    /// <inheritdoc />
 82    public Task<long> DeleteManyAsync(WorkflowExecutionLogRecordFilter filter, CancellationToken cancellationToken = def
 83    {
 084        var records = _store.Query(query => Filter(query, filter)).ToList();
 085        _store.DeleteMany(records, x => x.Id);
 086        return Task.FromResult(records.LongCount());
 87    }
 88
 489    private IQueryable<WorkflowExecutionLogRecord> Filter(IQueryable<WorkflowExecutionLogRecord> queryable, WorkflowExec
 90}

Methods/Properties

.ctor(Elsa.Common.Services.MemoryStore`1<Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord>)
AddAsync(Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord,System.Threading.CancellationToken)
AddManyAsync(System.Collections.Generic.IEnumerable`1<Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord>,System.Threading.CancellationToken)
SaveAsync(Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord,System.Threading.CancellationToken)
SaveManyAsync(System.Collections.Generic.IEnumerable`1<Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord>,System.Threading.CancellationToken)
FindAsync(Elsa.Workflows.Runtime.Filters.WorkflowExecutionLogRecordFilter,System.Threading.CancellationToken)
FindAsync(Elsa.Workflows.Runtime.Filters.WorkflowExecutionLogRecordFilter,Elsa.Workflows.Runtime.OrderDefinitions.WorkflowExecutionLogRecordOrder`1<TOrderBy>,System.Threading.CancellationToken)
FindManyAsync(Elsa.Workflows.Runtime.Filters.WorkflowExecutionLogRecordFilter,Elsa.Common.Models.PageArgs,System.Threading.CancellationToken)
FindManyAsync(Elsa.Workflows.Runtime.Filters.WorkflowExecutionLogRecordFilter,Elsa.Common.Models.PageArgs,Elsa.Workflows.Runtime.OrderDefinitions.WorkflowExecutionLogRecordOrder`1<TOrderBy>,System.Threading.CancellationToken)
DeleteManyAsync(Elsa.Workflows.Runtime.Filters.WorkflowExecutionLogRecordFilter,System.Threading.CancellationToken)
Filter(System.Linq.IQueryable`1<Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord>,Elsa.Workflows.Runtime.Filters.WorkflowExecutionLogRecordFilter)