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

lucaslorentz / auto-compute / 19292295081

12 Nov 2025 09:15AM UTC coverage: 83.163% (-0.3%) from 83.434%
19292295081

push

github

lucaslorentz
Allow custom consistency check for properties

0 of 23 new or added lines in 5 files covered. (0.0%)

2 existing lines in 1 file now uncovered.

1793 of 2156 relevant lines covered (83.16%)

881.85 hits per line

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

87.5
/src/LLL.AutoCompute.EFCore/Extensions/PropertyBuilderExtensions.cs
1
using System.Linq.Expressions;
2
using LLL.AutoCompute.EFCore.Metadata.Internal;
3
using Microsoft.EntityFrameworkCore.Metadata.Builders;
4

5
namespace LLL.AutoCompute.EFCore;
6

7
public static class PropertyBuilderExtensions
8
{
9
    public static PropertyBuilder<TProperty> AutoCompute<TEntity, TProperty>(
10
        this PropertyBuilder<TProperty> propertyBuilder,
11
        Expression<Func<TEntity, TProperty>> computedExpression,
12
        ChangeCalculatorSelector<TProperty, TProperty>? calculationSelector = null)
13
        where TEntity : class
14
    {
15
        var changeCalculation = calculationSelector?.Invoke(ChangeCalculators<TProperty>.Instance)
231✔
16
            ?? ChangeCalculators<TProperty>.Instance.CurrentValue();
231✔
17

18
        propertyBuilder.Metadata.SetComputedFactory(
231✔
19
            ComputedMemberFactory.CreateComputedPropertyFactory(
231✔
20
                computedExpression,
231✔
21
                changeCalculation));
231✔
22

23
        return propertyBuilder;
231✔
24
    }
25

26
    public static void ConsistencyCheck<TEntity, TProperty>(
27
        this PropertyBuilder<TProperty> propertyBuilder,
28
        Expression<Func<TEntity, bool>> check)
29
        where TEntity : class
30
    {
NEW
31
        propertyBuilder.Metadata.SetConsistencyCheck(check);
×
32
    }
33
}
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