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

lucaslorentz / auto-compute / 11763467169

10 Nov 2024 08:07AM UTC coverage: 77.292% (-12.0%) from 89.255%
11763467169

push

github

lucaslorentz
Add initial support for computed navigations and observers

168 of 433 new or added lines in 25 files covered. (38.8%)

7 existing lines in 5 files now uncovered.

1467 of 1898 relevant lines covered (77.29%)

109.86 hits per line

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

57.14
/src/LLL.AutoCompute.EFCore/ComputedOptionsBuilder.cs
1
using LLL.AutoCompute.EFCore.Internal;
2
using Microsoft.EntityFrameworkCore;
3
using Microsoft.EntityFrameworkCore.Metadata;
4

5
namespace LLL.AutoCompute.EFCore;
6

7
public class ComputedOptionsBuilder
8
{
9
    private readonly ComputedOptionsExtension _extension;
10
    private readonly DbContextOptionsBuilder _optionsBuilder;
11
    private bool _enableUpdateComputedsOnSave = true;
91✔
12

13
    public ComputedOptionsBuilder(DbContextOptionsBuilder optionsBuilder)
91✔
14
    {
15
        _extension = optionsBuilder.Options.FindExtension<ComputedOptionsExtension>()
91✔
16
            ?? new ComputedOptionsExtension();
91✔
17

18
        _optionsBuilder = optionsBuilder;
91✔
19
    }
20

21
    public ComputedOptionsBuilder AnalyzerFactory(Func<IServiceProvider, IModel, ComputedExpressionAnalyzer<IEFCoreComputedInput>>? factory)
22
    {
23
        _extension.AnalyzerFactory = factory;
×
24
        return this;
×
25
    }
26

27
    public ComputedOptionsBuilder ConfigureAnalyzer(Action<IServiceProvider, IModel, ComputedExpressionAnalyzer<IEFCoreComputedInput>> configuration)
28
    {
29
        _extension.AnalyzerConfigurations.Add(configuration);
×
30
        return this;
×
31
    }
32

33
    public ComputedOptionsBuilder EnableUpdateComputedsOnSave(bool enable)
34
    {
NEW
35
        _enableUpdateComputedsOnSave = enable;
×
NEW
36
        return this;
×
37
    }
38

39
    internal ComputedOptionsExtension Build()
40
    {
41
        if (_enableUpdateComputedsOnSave)
91✔
42
            _optionsBuilder.AddInterceptors(new ComputedInterceptor());
91✔
43

44
        return _extension;
91✔
45
    }
46
}
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