• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lucaslorentz / auto-compute / 13087746143

01 Feb 2025 10:27AM UTC coverage: 83.524% (+0.3%) from 83.178%
13087746143

push

github

lucaslorentz
Split DbContext update computeds from notify observers

64 of 68 new or added lines in 9 files covered. (94.12%)

3 existing lines in 2 files now uncovered.

1825 of 2185 relevant lines covered (83.52%)

428.51 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

76.92
/src/LLL.AutoCompute.EFCore/Metadata/Internal/ComputedObserver.cs
1
using LLL.AutoCompute.EFCore.Internal;
2

3
namespace LLL.AutoCompute.EFCore.Metadata.Internal;
4

5
public abstract class ComputedObserver(
6
    IComputedChangesProvider changesProvider)
7
    : ComputedBase(changesProvider)
6✔
8
{
9
    public abstract Task<Func<Task>?> CreateObserverNotifier(IEFCoreComputedInput input);
10
}
11

12
public class ComputedObserver<TEntity, TChange>(
13
    IComputedChangesProvider<IEFCoreComputedInput, TEntity, TChange> changesProvider,
14
    Func<ComputedChangeEventData<TEntity, TChange>, Task> callback
15
) : ComputedObserver(changesProvider)
6✔
16
    where TEntity : class
17
{
18
    public new IComputedChangesProvider<IEFCoreComputedInput, TEntity, TChange> ChangesProvider => changesProvider;
×
19

20
    public override string ToDebugString()
21
    {
22
        return "ComputedObserver";
×
23
    }
24

25
    public override async Task<Func<Task>?> CreateObserverNotifier(IEFCoreComputedInput input)
26
    {
27
        var changes = await changesProvider.GetChangesAsync(input, null);
12✔
28
        if (changes.Count == 0)
12✔
NEW
29
            return null;
×
30

31
        var eventData = new ComputedChangeEventData<TEntity, TChange>
12✔
32
        {
12✔
33
            DbContext = input.DbContext,
12✔
34
            Changes = changes
12✔
35
        };
12✔
36

37
        return () => callback(eventData);
24✔
38
    }
39
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc