Repository navigation
Expand file tree
/
Copy pathModifiers.cs
More file actions
55 lines (48 loc) · 1.5 KB
/
Copy pathModifiers.cs
File metadata and controls
55 lines (48 loc) · 1.5 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
using ServiceStack;
using ServiceStack.DataAnnotations;
namespace BlazorDiffusion.ServiceModel;
[Tag(Tag.Modifiers)]
public class QueryModifiers : QueryDb<Modifier> { }
[Tag(Tag.Modifiers)]
[ValidateHasRole(AppRoles.Moderator)]
[AutoApply(Behavior.AuditCreate)]
public class CreateModifier : ICreateDb<Modifier>, IReturn<Modifier>
{
[ValidateNotEmpty, Required]
public string Name { get; set; }
[ValidateNotEmpty, Required]
[Input(Type="select", EvalAllowableValues = "AppData.Categories")]
public string Category { get; set; }
public string? Description { get; set; }
}
[Tag(Tag.Modifiers)]
[ValidateHasRole(AppRoles.Moderator)]
[AutoApply(Behavior.AuditModify)]
public class UpdateModifier : IPatchDb<Modifier>, IReturn<Modifier>
{
public int Id { get; set; }
public string? Name { get; set; }
[Input(Type = "select", EvalAllowableValues = "AppData.Categories")]
public string? Category { get; set; }
public string? Description { get; set; }
}
[Tag(Tag.Modifiers)]
[ValidateHasRole(AppRoles.Moderator)]
[AutoApply(Behavior.AuditSoftDelete)]
public class DeleteModifier : IDeleteDb<Modifier>, IReturnVoid
{
public int Id { get; set; }
}
[Icon(Svg = Icons.Modifier)]
public class Modifier : AuditBase
{
[AutoIncrement]
public int Id { get; set; }
public string Name { get; set; }
public string Category { get; set; }
public string? Description { get; set; }
[Default(0)]
public int Score { get; set; }
[Default(0)]
public int Rank { get; set; }
}