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

lucaslorentz / auto-compute / 11755625072

09 Nov 2024 10:48AM UTC coverage: 79.945% (-0.09%) from 80.033%
11755625072

push

github

lucaslorentz
Add initial support for computed navigations and observers

159 of 359 new or added lines in 22 files covered. (44.29%)

41 existing lines in 7 files now uncovered.

1459 of 1825 relevant lines covered (79.95%)

113.62 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
    {
UNCOV
23
        _extension.AnalyzerFactory = factory;
×
UNCOV
24
        return this;
×
25
    }
26

27
    public ComputedOptionsBuilder ConfigureAnalyzer(Action<IServiceProvider, IModel, ComputedExpressionAnalyzer<IEFCoreComputedInput>> configuration)
28
    {
UNCOV
29
        _extension.AnalyzerConfigurations.Add(configuration);
×
UNCOV
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