-
-
Notifications
You must be signed in to change notification settings - Fork 159
/
SystemFile.cs
31 lines (25 loc) · 934 Bytes
/
SystemFile.cs
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
using System.ComponentModel.DataAnnotations;
using JetBrains.Annotations;
using JsonApiDotNetCore.Resources;
using JsonApiDotNetCore.Resources.Annotations;
namespace JsonApiDotNetCoreTests.IntegrationTests.InputValidation.ModelState;
[UsedImplicitly(ImplicitUseTargetFlags.Members)]
[Resource(ControllerNamespace = "JsonApiDotNetCoreTests.IntegrationTests.InputValidation.ModelState")]
public sealed class SystemFile : Identifiable<int>
{
[Attr]
[MinLength(1)]
public string FileName { get; set; } = null!;
[Attr]
[Required]
public FileAttributes? Attributes { get; set; }
[Attr]
[Range(typeof(long), "1", "9223372036854775807")]
public long SizeInBytes { get; set; }
[Attr]
[Range(typeof(DateOnly), "2000-01-01", "2050-01-01")]
public DateOnly CreatedOn { get; set; }
[Attr]
[Range(typeof(TimeOnly), "09:00:00", "17:30:00")]
public TimeOnly CreatedAt { get; set; }
}