• 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

31.58
/src/EntityFrameworkCore.Generator.Core/Metadata/Generation/PropertyCollection.cs
1
namespace EntityFrameworkCore.Generator.Metadata.Generation;
2

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

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

24
    /// <summary>
25
    /// Initializes a new instance of the <see cref="PropertyCollection"/> class.
26
    /// </summary>
27
    /// <param name="list">The list.</param>
UNCOV
28
    public PropertyCollection(List<Property> list) : base(list)
×
29
    {
UNCOV
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; }
105✔
39

40
    /// <summary>
41
    /// Gets the primary keys properties.
42
    /// </summary>
43
    /// <value>
44
    /// The primary keys properties.
45
    /// </value>
NEW
46
    public IEnumerable<Property> PrimaryKeys => this.Where(p => p.IsPrimaryKey == true);
×
47

48
    /// <summary>
49
    /// Gets the foreign keys properties.
50
    /// </summary>
51
    /// <value>
52
    /// The foreign keys.
53
    /// </value>
NEW
54
    public IEnumerable<Property> ForeignKeys => this.Where(p => p.IsForeignKey == true);
×
55

56
    /// <summary>
57
    /// Gets the property by column name
58
    /// </summary>
59
    /// <param name="columnName">Name of the column.</param>
60
    /// <returns></returns>
61
    public Property? ByColumn(string? columnName)
62
    {
63
        if (string.IsNullOrEmpty(columnName))
670!
NEW
64
            return null;
×
65

66
        return this.FirstOrDefault(x => x.ColumnName == columnName);
4,067✔
67
    }
68

69
    /// <summary>
70
    /// Gets the property by property name
71
    /// </summary>
72
    /// <param name="propertyName">Name of the property.</param>
73
    /// <returns></returns>
74
    public Property? ByProperty(string? propertyName)
75
    {
NEW
76
        if (string.IsNullOrEmpty(propertyName))
×
NEW
77
            return null;
×
78

UNCOV
79
        return this.FirstOrDefault(x => x.PropertyName == propertyName);
×
80
    }
81
}
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