Skip to content

Commit 531f8f2

Browse files
committed
Use 'required' properties.
Signed-off-by: Bradley Grainger <[email protected]>
1 parent 1bb13e0 commit 531f8f2

File tree

1 file changed

+13
-21
lines changed

1 file changed

+13
-21
lines changed

tools/SchemaCollectionGenerator/SchemaCollectionGenerator.cs

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System.ComponentModel.DataAnnotations;
2-
using System.Diagnostics.CodeAnalysis;
31
using System.Reflection;
42
using YamlDotNet.Serialization;
53
using YamlDotNet.Serialization.NamingConventions;
@@ -229,31 +227,25 @@ Restriction Name | Restriction Default | Restriction Number
229227

230228
class Schema
231229
{
232-
[AllowNull]
233-
public string Name { get; set; }
234-
public string? Description { get; set; }
235-
public string? Custom { get; set; }
236-
public string? Table { get; set; }
237-
public int IdentifierPartCount { get; set; }
238-
[AllowNull]
239-
public List<Column> Columns { get; set; }
240-
public List<Restriction>? Restrictions { get; set; }
230+
public required string Name { get; init; }
231+
public string? Description { get; init; }
232+
public string? Custom { get; init; }
233+
public string? Table { get; init; }
234+
public int IdentifierPartCount { get; init; }
235+
public required List<Column> Columns { get; init; }
236+
public List<Restriction>? Restrictions { get; init; }
241237
}
242238

243239
class Column
244240
{
245-
[AllowNull]
246-
public string Name { get; set; }
247-
[AllowNull]
248-
public string Type { get; set; }
249-
public string? Description { get; set; }
250-
public bool Optional { get; set; }
241+
public required string Name { get; init; }
242+
public required string Type { get; init; }
243+
public string? Description { get; init; }
244+
public bool Optional { get; init; }
251245
}
252246

253247
class Restriction
254248
{
255-
[AllowNull]
256-
public string Name { get; set; }
257-
[AllowNull]
258-
public string Default { get; set; }
249+
public required string Name { get; init; }
250+
public required string Default { get; init; }
259251
}

0 commit comments

Comments
 (0)