• 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

52.38
/src/EntityFrameworkCore.Generator.Core/Metadata/Generation/EntityCollection.cs
1
using System.Collections.Generic;
2
using System.Linq;
3

4
namespace EntityFrameworkCore.Generator.Metadata.Generation;
5

6
/// <summary>
7
/// A collection of <see cref="Entity"/>
8
/// </summary>
9
public class EntityCollection
10
    : List<Entity>
11
{
12
    /// <summary>
13
    /// Initializes a new instance of the <see cref="EntityCollection"/> class.
14
    /// </summary>
15
    public EntityCollection()
11✔
16
    {
17
    }
11✔
18

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

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

35
    /// <summary>
36
    /// Gets or sets a value indicating whether this instance is processed.
37
    /// </summary>
38
    /// <value>
39
    ///   <c>true</c> if this instance is processed; otherwise, <c>false</c>.
40
    /// </value>
41
    public bool IsProcessed { get; set; }
×
42

43
    /// <summary>
44
    /// Get <see cref="Entity" /> with the specified table <paramref name="tableName" /> and <paramref name="tableSchema" />.
45
    /// </summary>
46
    /// <param name="tableName">The name of the table.</param>
47
    /// <param name="tableSchema">The table schema.</param>
48
    /// <returns>
49
    /// The <see cref="Entity" /> with the specified table <paramref name="tableName" /> and <paramref name="tableSchema" />.
50
    /// </returns>
51
    public Entity? ByTable(string? tableName, string? tableSchema)
52
    {
53
        if (string.IsNullOrEmpty(tableName) && string.IsNullOrEmpty(tableSchema))
85!
NEW
54
            return null;
×
55

56
        return this.FirstOrDefault(x => x.TableName == tableName && x.TableSchema == tableSchema);
515✔
57
    }
58

59
    /// <summary>
60
    /// Get <see cref="Entity" /> with the specified <paramref name="className" />.
61
    /// </summary>
62
    /// <param name="className">Name of the class.</param>
63
    /// <returns>
64
    /// The <see cref="Entity" /> with the specified <paramref name="className" />.
65
    /// </returns>
66
    public Entity? ByClass(string? className)
67
    {
68
        if (string.IsNullOrEmpty(className))
22!
NEW
69
            return null;
×
70

71
        return this.FirstOrDefault(x => x.EntityClass == className);
154✔
72
    }
73
}
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