< Summary

Information
Class: Elsa.Persistence.EFCore.Modules.Identity.EFCoreApplicationStore
Assembly: Elsa.Persistence.EFCore
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore/Modules/Identity/ApplicationStore.cs
Line coverage
30%
Covered lines: 3
Uncovered lines: 7
Coverable lines: 10
Total lines: 41
Line coverage: 30%
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%
SaveAsync()100%210%
DeleteAsync()100%210%
FindAsync()100%210%
Filter(...)100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore/Modules/Identity/ApplicationStore.cs

#LineLine coverage
 1using Elsa.Identity.Contracts;
 2using Elsa.Identity.Entities;
 3using Elsa.Identity.Models;
 4
 5namespace Elsa.Persistence.EFCore.Modules.Identity;
 6
 7/// <summary>
 8/// An EF Core implementation of <see cref="IApplicationStore"/>.
 9/// </summary>
 10public class EFCoreApplicationStore : IApplicationStore
 11{
 12    private readonly EntityStore<IdentityElsaDbContext, Application> _applicationStore;
 13
 14    /// <summary>
 15    /// Initializes a new instance of <see cref="EFCoreApplicationStore"/>.
 16    /// </summary>
 117    public EFCoreApplicationStore(EntityStore<IdentityElsaDbContext, Application> applicationStore)
 18    {
 119        _applicationStore = applicationStore;
 120    }
 21
 22    /// <inheritdoc />
 23    public async Task SaveAsync(Application application, CancellationToken cancellationToken = default)
 24    {
 025        await _applicationStore.SaveAsync(application, cancellationToken);
 026    }
 27
 28    /// <inheritdoc />
 29    public async Task DeleteAsync(ApplicationFilter filter, CancellationToken cancellationToken = default)
 30    {
 031        await _applicationStore.DeleteWhereAsync(query => Filter(query, filter), cancellationToken);
 032    }
 33
 34    /// <inheritdoc />
 35    public async Task<Application?> FindAsync(ApplicationFilter filter, CancellationToken cancellationToken = default)
 36    {
 037        return await _applicationStore.FindAsync(query => Filter(query, filter), cancellationToken);
 038    }
 39
 040    private static IQueryable<Application> Filter(IQueryable<Application> query, ApplicationFilter filter) => filter.App
 41}