• 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

86.49
/src/EntityFrameworkCore.Generator.Core/Metadata/Generation/Entity.cs
1
using System.Diagnostics;
2

3
namespace EntityFrameworkCore.Generator.Metadata.Generation;
4

5
/// <summary>
6
/// An entity model for a database table used when reverse engineering an existing database.
7
/// </summary>
8
/// <seealso cref="ModelBase" />
9
[DebuggerDisplay("Class: {EntityClass}, Table: {TableName}, Context: {ContextProperty}")]
10
public class Entity : ModelBase, IOptionVariable
11
{
12
    /// <summary>
13
    /// Initializes a new instance of the <see cref="Entity"/> class.
14
    /// </summary>
15
    public Entity()
42✔
16
    {
17
        Properties = [];
42✔
18
        Relationships = [];
42✔
19
        Methods = [];
42✔
20
        Models = [];
42✔
21
    }
42✔
22

23
    /// <summary>
24
    /// Gets or sets the parent <see cref="EntityContext"/> this entity belong to.
25
    /// </summary>
26
    /// <value>
27
    /// The parent context this entity belongs to.
28
    /// </value>
29
    public EntityContext Context { get; set; } = null!;
42✔
30

31
    /// <summary>
32
    /// Gets or sets the property name for this entity on the data context.
33
    /// </summary>
34
    /// <value>
35
    /// The property name for this entity on the data context.
36
    /// </value>
37
    public string ContextProperty { get; set; } = null!;
130✔
38

39

40
    /// <summary>
41
    /// Gets or sets the entity namespace.
42
    /// </summary>
43
    /// <value>
44
    /// The entity namespace.
45
    /// </value>
46
    public string EntityNamespace { get; set; } = null!;
339✔
47

48
    /// <summary>
49
    /// Gets or sets the name of the entity class.
50
    /// </summary>
51
    /// <value>
52
    /// The name of the entity class.
53
    /// </value>
54
    public string EntityClass { get; set; } = null!;
1,625✔
55

56
    /// <summary>
57
    /// Gets or sets the entity base class.
58
    /// </summary>
59
    /// <value>
60
    /// The entity base class.
61
    /// </value>
62
    public string? EntityBaseClass { get; set; }
75✔
63

64

65
    /// <summary>
66
    /// Gets or sets the mapping namespace.
67
    /// </summary>
68
    /// <value>
69
    /// The mapping namespace.
70
    /// </value>
71
    public string MappingNamespace { get; set; } = null!;
115✔
72

73
    /// <summary>
74
    /// Gets or sets the name of the table mapping class.
75
    /// </summary>
76
    /// <value>
77
    /// The name of the table mapping class.
78
    /// </value>
79
    public string MappingClass { get; set; } = null!;
203✔
80

81

82
    /// <summary>
83
    /// Gets or sets the mapper class.
84
    /// </summary>
85
    /// <value>
86
    /// The mapper class.
87
    /// </value>
88
    public string MapperClass { get; set; } = null!;
4✔
89

90
    /// <summary>
91
    /// Gets or sets the mapper namespace.
92
    /// </summary>
93
    /// <value>
94
    /// The mapper namespace.
95
    /// </value>
96
    public string MapperNamespace { get; set; } = null!;
4✔
97

98
    /// <summary>
99
    /// Gets or sets the mapper base class.
100
    /// </summary>
101
    /// <value>
102
    /// The mapper base class.
103
    /// </value>
104
    public string? MapperBaseClass { get; set; }
2✔
105

106

107
    /// <summary>
108
    /// Gets or sets the table schema.
109
    /// </summary>
110
    /// <value>
111
    /// The table schema.
112
    /// </value>
113
    public string? TableSchema { get; set; }
300✔
114

115
    /// <summary>
116
    /// Gets or sets the name of the table.
117
    /// </summary>
118
    /// <value>
119
    /// The name of the table.
120
    /// </value>
121
    public string TableName { get; set; } = null!;
653✔
122

123

124
    /// <summary>
125
    /// Gets or sets the entity's properties.
126
    /// </summary>
127
    /// <value>
128
    /// The entity's properties.
129
    /// </value>
130
    public PropertyCollection Properties { get; set; }
1,291✔
131

132
    /// <summary>
133
    /// Gets or sets the entity's relationships.
134
    /// </summary>
135
    /// <value>
136
    /// The entity's relationships.
137
    /// </value>
138
    public RelationshipCollection Relationships { get; set; }
333✔
139

140
    /// <summary>
141
    /// Gets or sets the entity's methods.
142
    /// </summary>
143
    /// <value>
144
    /// The entity's methods.
145
    /// </value>
146
    public MethodCollection Methods { get; set; }
261✔
147

148

149
    /// <summary>
150
    /// Gets or sets the models for this entity.
151
    /// </summary>
152
    /// <value>
153
    /// The models for this entity.
154
    /// </value>
155
    public ModelCollection Models { get; set; }
211✔
156

157
    /// <summary>
158
    /// Gets or sets a value indicating whether this instance is view.
159
    /// </summary>
160
    /// <value>
161
    ///   <c>true</c> if this instance is view; otherwise, <c>false</c>.
162
    /// </value>
163
    public bool IsView { get; set; }
75✔
164

165

166
    /// <summary>
167
    /// Gets or sets the name of the temporal table.
168
    /// </summary>
169
    /// <value>
170
    /// The name of the temporal table.
171
    /// </value>
172
    public string? TemporalTableName { get; set; }
33✔
173

174
    /// <summary>
175
    /// Gets or sets the temporal table schema.
176
    /// </summary>
177
    /// <value>
178
    /// The temporal table schema.
179
    /// </value>
NEW
180
    public string? TemporalTableSchema { get; set; }
×
181

182
    /// <summary>
183
    /// Gets or sets the temporal start property.
184
    /// </summary>
185
    /// <value>
186
    /// The temporal start property.
187
    /// </value>
NEW
188
    public string? TemporalStartProperty { get; set; }
×
189

190
    /// <summary>
191
    /// Gets or sets the temporal start column.
192
    /// </summary>
193
    /// <value>
194
    /// The temporal start column.
195
    /// </value>
NEW
196
    public string? TemporalStartColumn { get; set; }
×
197

198
    /// <summary>
199
    /// Gets or sets the temporal end property.
200
    /// </summary>
201
    /// <value>
202
    /// The temporal end property.
203
    /// </value>
NEW
204
    public string? TemporalEndProperty { get; set; }
×
205

206
    /// <summary>
207
    /// Gets or sets the temporal end column.
208
    /// </summary>
209
    /// <value>
210
    /// The temporal end column.
211
    /// </value>
NEW
212
    public string? TemporalEndColumn { get; set; }
×
213

214
    void IOptionVariable.Set(VariableDictionary variableDictionary)
215
    {
216
        variableDictionary.Set(VariableConstants.TableSchema, TableSchema);
108✔
217
        variableDictionary.Set(VariableConstants.TableName, TableName);
108✔
218
        variableDictionary.Set(VariableConstants.EntityName, EntityClass);
108✔
219
    }
108✔
220

221
    void IOptionVariable.Remove(VariableDictionary variableDictionary)
222
    {
223
        variableDictionary.Remove(VariableConstants.TableSchema);
108✔
224
        variableDictionary.Remove(VariableConstants.TableName);
108✔
225
        variableDictionary.Remove(VariableConstants.EntityName);
108✔
226
    }
108✔
227
}
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