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

loresoft / EntityFrameworkCore.Generator / 27767067052

18 Jun 2026 02:35PM UTC coverage: 70.481% (-4.9%) from 75.418%
27767067052

push

github

pwelter34
Update SourceSynchronizer.cs

913 of 1785 branches covered (51.15%)

Branch coverage included in aggregate %.

5 of 6 new or added lines in 1 file covered. (83.33%)

297 existing lines in 10 files now uncovered.

4094 of 5319 relevant lines covered (76.97%)

1291.15 hits per line

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

59.38
/src/EntityFrameworkCore.Generator.Core/Parsing/ContextParser.cs
1
using EntityFrameworkCore.Generator.Metadata.Parsing;
2

3
using Microsoft.CodeAnalysis.CSharp;
4
using Microsoft.CodeAnalysis.CSharp.Syntax;
5
using Microsoft.Extensions.Logging;
6

7
namespace EntityFrameworkCore.Generator.Parsing;
8

9
public class ContextParser
10
{
11
    private readonly ILogger _logger;
12

13
    public ContextParser(ILoggerFactory loggerFactory)
3✔
14
    {
15
        _logger = loggerFactory.CreateLogger<ContextParser>();
3✔
16
    }
3✔
17

18
    public ParsedContext? ParseFile(string contextFile)
19
    {
UNCOV
20
        if (string.IsNullOrEmpty(contextFile) || !File.Exists(contextFile))
×
21
            return null;
×
22

UNCOV
23
        _logger.LogDebug(
×
UNCOV
24
            "Parsing Context File: '{ContextFile}'",
×
UNCOV
25
            Path.GetFileName(contextFile));
×
26

UNCOV
27
        var code = File.ReadAllText(contextFile);
×
UNCOV
28
        return ParseCode(code);
×
29
    }
30

31
    public ParsedContext? ParseCode(string code)
32
    {
33
        if (string.IsNullOrWhiteSpace(code))
3!
34
            return null;
×
35

36
        var syntaxTree = CSharpSyntaxTree.ParseText(code);
3✔
37
        var root = (CompilationUnitSyntax)syntaxTree.GetRoot();
3✔
38

39
        var visitor = new ContextVisitor();
3✔
40
        visitor.Visit(root);
3✔
41

42
        var parsedContext = visitor.ParsedContext;
3✔
43
        if (parsedContext == null)
3✔
44
            return null;
1✔
45

46
        _logger.LogDebug(
2✔
47
            "Parsed Context Class: {ContextClass}; Entities: {Entities}",
2✔
48
            parsedContext.ContextClass,
2✔
49
            parsedContext.Properties.Count);
2✔
50

51
        return parsedContext;
2✔
52
    }
53
}
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