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

lucaslorentz / auto-compute / 20626184500

31 Dec 2025 07:56PM UTC coverage: 80.751% (-0.7%) from 81.446%
20626184500

push

github

lucaslorentz
Allow customizing the consistency equality

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

1892 of 2343 relevant lines covered (80.75%)

867.46 hits per line

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

77.78
/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 changeCalculator = calculationSelector?.Invoke(ChangeCalculatorFactory<TProperty>.Instance)
231✔
16
            ?? ChangeCalculatorFactory<TProperty>.Instance.CurrentValue();
231✔
17

18
        propertyBuilder.Metadata.SetComputedFactory(
231✔
19
            ComputedMemberFactory.CreateComputedPropertyFactory(
231✔
20
                computedExpression,
231✔
21
                changeCalculator));
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
    {
31
        propertyBuilder.Metadata.SetConsistencyCheck(check);
×
32
    }
33

34
    public static void ConsistencyEquality<TProperty>(
35
        this PropertyBuilder<TProperty> propertyBuilder,
36
        Expression<Func<TProperty, TProperty, bool>> areEqual)
37
    {
NEW
38
        propertyBuilder.Metadata.SetConsistencyEquality(areEqual);
×
39
    }
40
}
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