< Summary

Information
Class: Elsa.Persistence.EFCore.Modules.Runtime.EFCoreKeyValueStore
Assembly: Elsa.Persistence.EFCore
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore/Modules/Runtime/KeyValueStore.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 5
Coverable lines: 5
Total lines: 37
Line coverage: 0%
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%210%
SaveAsync(...)100%210%
FindAsync(...)100%210%
FindManyAsync(...)100%210%
DeleteAsync(...)100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore/Modules/Runtime/KeyValueStore.cs

#LineLine coverage
 1using Elsa.KeyValues.Contracts;
 2using Elsa.KeyValues.Entities;
 3using Elsa.KeyValues.Models;
 4using JetBrains.Annotations;
 5
 6namespace Elsa.Persistence.EFCore.Modules.Runtime;
 7
 8/// <summary>
 9/// Entity Framework implementation of the <see cref="IKeyValueStore"/>
 10/// </summary>
 11[UsedImplicitly]
 012public class EFCoreKeyValueStore(Store<RuntimeElsaDbContext, SerializedKeyValuePair> store) : IKeyValueStore
 13{
 14    /// <inheritdoc />
 15    public Task SaveAsync(SerializedKeyValuePair keyValuePair, CancellationToken cancellationToken)
 16    {
 017        return store.SaveAsync(keyValuePair, x => x.Id, cancellationToken);
 18    }
 19
 20    /// <inheritdoc />
 21    public Task<SerializedKeyValuePair?> FindAsync(KeyValueFilter filter, CancellationToken cancellationToken)
 22    {
 023        return store.FindAsync(filter.Apply, cancellationToken);
 24    }
 25
 26    /// <inheritdoc />
 27    public Task<IEnumerable<SerializedKeyValuePair>> FindManyAsync(KeyValueFilter filter, CancellationToken cancellation
 28    {
 029        return store.QueryAsync(filter.Apply, cancellationToken);
 30    }
 31
 32    /// <inheritdoc />
 33    public Task DeleteAsync(string key, CancellationToken cancellationToken)
 34    {
 035        return store.DeleteWhereAsync(x => x.Id == key, cancellationToken);
 36    }
 37}