-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathArtists.cs
More file actions
58 lines (51 loc) · 1.58 KB
/
Artists.cs
File metadata and controls
58 lines (51 loc) · 1.58 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System.Collections.Generic;
using ServiceStack;
using ServiceStack.DataAnnotations;
namespace BlazorDiffusion.ServiceModel;
[Tag(Tag.Artists)]
public class QueryArtists : QueryDb<Artist> {}
[Tag(Tag.Artists)]
[ValidateHasRole(AppRoles.Moderator)]
[AutoApply(Behavior.AuditCreate)]
public class CreateArtist : ICreateDb<Artist>, IReturn<Artist>
{
public string? FirstName { get; set; }
[ValidateNotEmpty, Required]
public string LastName { get; set; }
public int? YearDied { get; set; }
[Input(Type = "tag"), FieldCss(Field = "col-span-12")]
public List<string>? Type { get; set; }
}
[Tag(Tag.Artists)]
[ValidateHasRole(AppRoles.Moderator)]
[AutoApply(Behavior.AuditModify)]
public class UpdateArtist : IPatchDb<Artist>, IReturn<Artist>
{
public int Id { get; set; }
public string? FirstName { get; set; }
public string? LastName { get; set; }
public int? YearDied { get; set; }
[Input(Type = "tag"), FieldCss(Field = "col-span-12")]
public List<string>? Type { get; set; }
}
[Tag(Tag.Artists)]
[ValidateHasRole(AppRoles.Moderator)]
[AutoApply(Behavior.AuditSoftDelete)]
public class DeleteArtist : IDeleteDb<Artist>, IReturnVoid
{
public int Id { get; set; }
}
[Icon(Svg = Icons.Artist)]
public class Artist : AuditBase
{
[AutoIncrement]
public int Id { get; set; }
public string? FirstName { get; set; }
public string LastName { get; set; }
public int? YearDied { get; set; }
public List<string>? Type { get; set; }
[Default(0)]
public int Score { get; set; }
[Default(0)]
public int Rank { get; set; }
}