• 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

0.0
/src/EntityFrameworkCore.Generator.Core/Parsing/MappingParser.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 MappingParser
10
{
11
    private readonly ILogger _logger;
12

UNCOV
13
    public MappingParser(ILoggerFactory loggerFactory)
×
14
    {
UNCOV
15
        _logger = loggerFactory.CreateLogger<MappingParser>();
×
UNCOV
16
    }
×
17

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

UNCOV
23
        _logger.LogDebug(
×
UNCOV
24
            "Parsing Mapping File: '{MappingFile}'",
×
UNCOV
25
            Path.GetFileName(mappingFile));
×
26

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

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

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

UNCOV
39
        var visitor = new MappingVisitor();
×
UNCOV
40
        visitor.Visit(root);
×
41

UNCOV
42
        var parsedEntity = visitor.ParsedEntity;
×
43

UNCOV
44
        if (parsedEntity == null)
×
45
            return null;
×
46

UNCOV
47
        _logger.LogDebug(
×
UNCOV
48
            "Parsed Mapping Class: '{MappingClass}'; Properties: {Properties}; Relationships: {Relationships}",
×
UNCOV
49
            parsedEntity.MappingClass,
×
UNCOV
50
            parsedEntity.Properties.Count,
×
UNCOV
51
            parsedEntity.Relationships.Count);
×
52

UNCOV
53
        return parsedEntity;
×
54
    }
55
}
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