-
-
Notifications
You must be signed in to change notification settings - Fork 163
Expand file tree
/
Copy pathArticle.cs
More file actions
25 lines (19 loc) · 871 Bytes
/
Article.cs
File metadata and controls
25 lines (19 loc) · 871 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
using JetBrains.Annotations;
using JsonApiDotNetCore.Resources;
using JsonApiDotNetCore.Resources.Annotations;
namespace OpenApiTests.Capabilities;
[UsedImplicitly(ImplicitUseTargetFlags.Members)]
[Resource(ControllerNamespace = "OpenApiTests.Capabilities")]
public sealed class Article : Identifiable<long>
{
[Attr]
public string Headline { get; set; } = null!;
[HasOne(Capabilities = HasOneCapabilities.AllowSet)]
public Writer? Writer { get; set; }
[HasMany(Capabilities = HasManyCapabilities.AllowView)]
public ISet<Category> Categories { get; set; } = new HashSet<Category>();
[HasMany(Capabilities = HasManyCapabilities.AllowAdd)]
public ISet<Tag> Tags { get; set; } = new HashSet<Tag>();
[HasMany(Capabilities = HasManyCapabilities.AllowRemove)]
public ISet<Comment> Comments { get; set; } = new HashSet<Comment>();
}