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

lucaslorentz / auto-compute / 19783212428

29 Nov 2025 11:22AM UTC coverage: 82.741%. Remained the same
19783212428

push

github

lucaslorentz
Rename annotations

21 of 30 new or added lines in 2 files covered. (70.0%)

1793 of 2167 relevant lines covered (82.74%)

877.31 hits per line

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

14.29
/src/LLL.AutoCompute.EFCore/Metadata/Conventions/RemoveComputedAnnotationsConvention.cs
1
using LLL.AutoCompute.EFCore.Metadata.Internal;
2
using Microsoft.EntityFrameworkCore;
3
using Microsoft.EntityFrameworkCore.Metadata;
4
using Microsoft.EntityFrameworkCore.Metadata.Builders;
5
using Microsoft.EntityFrameworkCore.Metadata.Conventions;
6

7
namespace LLL.AutoCompute.EFCore.Metadata.Conventions;
8

9
class RemoveComputedAnnotationsConvention : IModelFinalizingConvention
10
{
11
    public void ProcessModelFinalizing(IConventionModelBuilder modelBuilder, IConventionContext<IConventionModelBuilder> context)
12
    {
13
        if (!EF.IsDesignTime)
30✔
14
            return;
30✔
15

16
        var annotatables = modelBuilder.Metadata.GetEntityTypes()
×
17
            .SelectMany(e => new IConventionAnnotatable[] { e }.Concat(e.GetMembers().OfType<IConventionAnnotatable>()))
×
18
            .Concat([modelBuilder.Metadata])
×
19
            .ToArray();
×
20

21
        foreach (var annotatable in annotatables)
×
22
        {
23
            var computedAnnotations = annotatable
×
24
                .GetAnnotations()
×
NEW
25
                .Where(a => a.Name.StartsWith(AutoComputeAnnotationNames.TempPrefix))
×
26
                .ToArray();
×
27

28
            if (computedAnnotations.Length > 0)
×
29
            {
30
                foreach (var annotation in computedAnnotations)
×
31
                    annotatable.RemoveAnnotation(annotation.Name);
×
32
            }
33
        }
34
    }
35
}
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