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

loresoft / EntityFrameworkCore.Generator / 15072048022

16 May 2025 03:31PM UTC coverage: 55.392% (-1.4%) from 56.772%
15072048022

push

github

pwelter34
enable nullable support

616 of 1271 branches covered (48.47%)

Branch coverage included in aggregate %.

233 of 397 new or added lines in 61 files covered. (58.69%)

17 existing lines in 11 files now uncovered.

1824 of 3134 relevant lines covered (58.2%)

88.56 hits per line

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

17.65
/src/EntityFrameworkCore.Generator.Core/Metadata/Generation/RelationshipCollection.cs
1
namespace EntityFrameworkCore.Generator.Metadata.Generation;
2

3
/// <summary>
4
/// A collection of <see cref="Relationship"/> instances
5
/// </summary>
6
public class RelationshipCollection
7
    : List<Relationship>
8
{
9
    /// <summary>
10
    /// Initializes a new instance of the <see cref="RelationshipCollection"/> class.
11
    /// </summary>
12
    public RelationshipCollection()
42✔
13
    {
14
    }
42✔
15

16
    /// <summary>
17
    /// Initializes a new instance of the <see cref="RelationshipCollection"/> class.
18
    /// </summary>
19
    /// <param name="collection">The collection whose elements are copied to the new list.</param>
20
    public RelationshipCollection(IEnumerable<Relationship> collection) : base(collection)
×
21
    {
22
    }
×
23

24
    /// <summary>
25
    /// Initializes a new instance of the <see cref="RelationshipCollection"/> class.
26
    /// </summary>
27
    /// <param name="capacity">The number of elements that the new list can initially store.</param>
28
    public RelationshipCollection(int capacity) : base(capacity)
×
29
    {
30
    }
×
31

32
    /// <summary>
33
    /// Gets or sets a value indicating whether this instance is processed.
34
    /// </summary>
35
    /// <value>
36
    ///   <c>true</c> if this instance is processed; otherwise, <c>false</c>.
37
    /// </value>
38
    public bool IsProcessed { get; set; }
84✔
39

40
    /// <summary>
41
    /// Gets a relationship by name.
42
    /// </summary>
43
    /// <param name="name">The name.</param>
44
    /// <returns></returns>
45
    public Relationship? ByName(string? name)
46
    {
NEW
47
        if (string.IsNullOrEmpty(name))
×
NEW
48
            return null;
×
49

UNCOV
50
        return this.FirstOrDefault(x => x.RelationshipName == name);
×
51
    }
52

53
    /// <summary>
54
    /// Gets a relationship by the property name.
55
    /// </summary>
56
    /// <param name="propertyName">Name of the property.</param>
57
    /// <returns></returns>
58
    public Relationship? ByProperty(string propertyName)
59
    {
NEW
60
        if (string.IsNullOrEmpty(propertyName))
×
NEW
61
            return null;
×
62

UNCOV
63
        return this.FirstOrDefault(x => x.PropertyName == propertyName);
×
64
    }
65
}
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

© 2025 Coveralls, Inc