-
-
Notifications
You must be signed in to change notification settings - Fork 162
Expand file tree
/
Copy pathPerson.cs
More file actions
35 lines (27 loc) · 719 Bytes
/
Person.cs
File metadata and controls
35 lines (27 loc) · 719 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using JetBrains.Annotations;
using JsonApiDotNetCore.Resources;
using JsonApiDotNetCore.Resources.Annotations;
namespace GettingStarted.Models;
[UsedImplicitly(ImplicitUseTargetFlags.Members)]
[Resource]
public sealed class Person : Identifiable<int>
{
[Attr]
public string Name { get; set; } = null!;
[Attr]
public bool IsDeleted { get; set; }
[HasMany]
public ICollection<Book> Books { get; set; } = new List<Book>();
[HasOne]
public House? House { get; set; }
}
[Resource]
public abstract class House : Identifiable<int>;
[Resource]
public sealed class TinyHouse : House;
[Resource]
public sealed class BigHouse : House
{
[Attr]
public int? FloorCount { get; set; }
}