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

lucaslorentz / auto-compute / 11758703019

09 Nov 2024 07:01PM UTC coverage: 77.208% (-2.7%) from 79.869%
11758703019

push

github

lucaslorentz
Add initial support for computed navigations and observers

160 of 425 new or added lines in 23 files covered. (37.65%)

41 existing lines in 7 files now uncovered.

1460 of 1891 relevant lines covered (77.21%)

109.64 hits per line

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

0.0
/src/LLL.AutoCompute.EFCore/Metadata/Internal/ComputedObserver.cs
1
using LLL.AutoCompute.EFCore.Internal;
2
using Microsoft.EntityFrameworkCore;
3

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

6
public class ComputedObserver<TEntity, TChange>(
7
    IUnboundChangesProvider<IEFCoreComputedInput, TEntity, TChange> changesProvider,
8
    Func<ComputedChangeEventData<TEntity, TChange>, Task> callback
NEW
9
) : Computed(changesProvider)
×
10
    where TEntity : class
11
{
12
    public override string ToDebugString()
13
    {
NEW
14
        return "Observer";
×
15
    }
16

17
    public override async Task<int> Update(DbContext dbContext)
18
    {
NEW
19
        var numberOfUpdates = 0;
×
NEW
20
        var input = dbContext.GetComputedInput();
×
NEW
21
        var changes = await changesProvider.GetChangesAsync(input, null);
×
NEW
22
        var eventData = new ComputedChangeEventData<TEntity, TChange>
×
NEW
23
        {
×
NEW
24
            DbContext = dbContext,
×
NEW
25
            Changes = changes
×
NEW
26
        };
×
NEW
27
        await callback(eventData);
×
NEW
28
        return numberOfUpdates;
×
29
    }
30
}
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