< Summary

Information
Class: Elsa.Persistence.EFCore.Modules.Identity.EFCoreUserStore
Assembly: Elsa.Persistence.EFCore
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore/Modules/Identity/UserStore.cs
Line coverage
12%
Covered lines: 1
Uncovered lines: 7
Coverable lines: 8
Total lines: 31
Line coverage: 12.5%
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/UserStore.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="IUserStore"/>.
 9/// </summary>
 110public class EFCoreUserStore(EntityStore<IdentityElsaDbContext, User> userStore) : IUserStore
 11{
 12    /// <inheritdoc />
 13    public async Task SaveAsync(User user, CancellationToken cancellationToken = default)
 14    {
 015        await userStore.SaveAsync(user, cancellationToken);
 016    }
 17
 18    /// <inheritdoc />
 19    public async Task DeleteAsync(UserFilter filter, CancellationToken cancellationToken = default)
 20    {
 021        await userStore.DeleteWhereAsync(query => Filter(query, filter), cancellationToken);
 022    }
 23
 24    /// <inheritdoc />
 25    public async Task<User?> FindAsync(UserFilter filter, CancellationToken cancellationToken = default)
 26    {
 027        return await userStore.FindAsync(query => Filter(query, filter), cancellationToken);
 028    }
 29
 030    private static IQueryable<User> Filter(IQueryable<User> query, UserFilter filter) => filter.Apply(query);
 31}