< Summary

Information
Class: Elsa.Persistence.EFCore.EntityStore<T1, T2>
Assembly: Elsa.Persistence.EFCore.Common
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore.Common/EntityStore.cs
Line coverage
60%
Covered lines: 3
Uncovered lines: 2
Coverable lines: 5
Total lines: 43
Line coverage: 60%
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%
SaveAsync()100%11100%
SaveManyAsync()100%210%
SaveManyAsync()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore.Common/EntityStore.cs

#LineLine coverage
 1using Elsa.Common.Entities;
 2using Microsoft.EntityFrameworkCore;
 3
 4namespace Elsa.Persistence.EFCore;
 5
 6/// <summary>
 7/// A generic repository class around EF Core for accessing entities that inherit from <see cref="Entity"/>.
 8/// </summary>
 9/// <typeparam name="TDbContext">The type of the database context.</typeparam>
 10/// <typeparam name="TEntity">The type of the entity.</typeparam>
 11public class EntityStore<TDbContext, TEntity>(IDbContextFactory<TDbContext> dbContextFactory, IServiceProvider servicePr
 225512    : Store<TDbContext, TEntity>(dbContextFactory, serviceProvider) where TDbContext : DbContext where TEntity : Entity,
 13{
 14    /// <summary>
 15    /// Saves the entity.
 16    /// </summary>
 17    /// <param name="entity">The entity to save.</param>
 18    /// <param name="cancellationToken">The cancellation token.</param>
 019    public async Task SaveAsync(TEntity entity, CancellationToken cancellationToken = default) => await SaveAsync(entity
 20
 21    /// <summary>
 22    /// Saves the entity.
 23    /// </summary>
 24    /// <param name="entity">The entity to save.</param>
 25    /// <param name="onSaving">The callback to invoke before saving the entity.</param>
 26    /// <param name="cancellationToken">The cancellation token.</param>
 36027    public async Task SaveAsync(TEntity entity, Func<TDbContext, TEntity, CancellationToken, ValueTask>? onSaving, Cance
 28
 29    /// <summary>
 30    /// Saves the specified entities.
 31    /// </summary>
 32    /// <param name="entities">The entities to save.</param>
 33    /// <param name="cancellationToken">The cancellation token.</param>
 034    public async Task SaveManyAsync(IEnumerable<TEntity> entities, CancellationToken cancellationToken = default) => awa
 35
 36    /// <summary>
 37    /// Saves the specified entities.
 38    /// </summary>
 39    /// <param name="entities">The entities to save.</param>
 40    /// <param name="onSaving">The callback to invoke before saving the entities.</param>
 41    /// <param name="cancellationToken">The cancellation token.</param>
 138542    public async Task SaveManyAsync(IEnumerable<TEntity> entities, Func<TDbContext, TEntity, CancellationToken, ValueTas
 43}