< Summary

Information
Class: Elsa.Persistence.EFCore.Modules.Labels.EFCoreWorkflowDefinitionLabelStore
Assembly: Elsa.Persistence.EFCore
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore/Modules/Labels/WorkflowDefinitionLabelStore.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 17
Coverable lines: 17
Total lines: 58
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

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore/Modules/Labels/WorkflowDefinitionLabelStore.cs

#LineLine coverage
 1using Elsa.Labels.Contracts;
 2using Elsa.Labels.Entities;
 3
 4namespace Elsa.Persistence.EFCore.Modules.Labels;
 5
 6/// <inheritdoc />
 7public class EFCoreWorkflowDefinitionLabelStore : IWorkflowDefinitionLabelStore
 8{
 9    private readonly EntityStore<LabelsElsaDbContext, WorkflowDefinitionLabel> _store;
 10
 11    /// <summary>
 12    /// Constructor
 13    /// </summary>
 014    public EFCoreWorkflowDefinitionLabelStore(EntityStore<LabelsElsaDbContext, WorkflowDefinitionLabel> store) => _store
 15
 16    /// <inheritdoc />
 017    public async Task SaveAsync(WorkflowDefinitionLabel record, CancellationToken cancellationToken = default) => await 
 18
 19    /// <inheritdoc />
 020    public async Task SaveManyAsync(IEnumerable<WorkflowDefinitionLabel> records, CancellationToken cancellationToken = 
 21
 22    /// <inheritdoc />
 023    public async Task<bool> DeleteAsync(string id, CancellationToken cancellationToken = default) => await _store.Delete
 24
 25    /// <inheritdoc />
 26    public async Task<IEnumerable<WorkflowDefinitionLabel>> FindByWorkflowDefinitionVersionIdAsync(string workflowDefini
 027        await _store.FindManyAsync(x => x.WorkflowDefinitionVersionId == workflowDefinitionVersionId, cancellationToken)
 28
 29    /// <inheritdoc />
 30    public async Task ReplaceAsync(IEnumerable<WorkflowDefinitionLabel> removed, IEnumerable<WorkflowDefinitionLabel> ad
 31    {
 032        var idList = removed.Select(r => r.Id);
 033        await _store.DeleteWhereAsync(w => idList.Contains(w.Id), cancellationToken);
 034        await _store.SaveManyAsync(added, cancellationToken);
 035    }
 36
 37    /// <inheritdoc />
 38    public async Task<long> DeleteByWorkflowDefinitionIdAsync(string workflowDefinitionId, CancellationToken cancellatio
 039        await _store.DeleteWhereAsync(x => x.WorkflowDefinitionId == workflowDefinitionId, cancellationToken);
 40
 41    /// <inheritdoc />
 42    public async Task<long> DeleteByWorkflowDefinitionVersionIdAsync(string workflowDefinitionVersionId, CancellationTok
 043        await _store.DeleteWhereAsync(x => x.WorkflowDefinitionVersionId == workflowDefinitionVersionId, cancellationTok
 44
 45    /// <inheritdoc />
 46    public async Task<long> DeleteByWorkflowDefinitionIdsAsync(IEnumerable<string> workflowDefinitionIds, CancellationTo
 47    {
 048        var ids = workflowDefinitionIds.ToList();
 049        return await _store.DeleteWhereAsync(x => ids.Contains(x.WorkflowDefinitionId), cancellationToken);
 050    }
 51
 52    /// <inheritdoc />
 53    public async Task<long> DeleteByWorkflowDefinitionVersionIdsAsync(IEnumerable<string> workflowDefinitionVersionIds, 
 54    {
 055        var ids = workflowDefinitionVersionIds.ToList();
 056        return await _store.DeleteWhereAsync(x => ids.Contains(x.WorkflowDefinitionVersionId), cancellationToken);
 057    }
 58}