aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Models/Validation
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-02-08 21:40:18 +0800
committerGitHub <noreply@github.com>2021-02-08 21:40:18 +0800
commite62cf8eb79c8b99eeff41a47b489af1ecde4fe49 (patch)
tree19511644c678f7bbb67d1b5aa14e5bd234f40c1f /BackEnd/Timeline/Models/Validation
parente6ccb7b00c1433197bec872a47cd68ea81c44d7b (diff)
parent45b683d582d4a7760ffd69c4cd47841ce0545119 (diff)
downloadtimeline-e62cf8eb79c8b99eeff41a47b489af1ecde4fe49.tar.gz
timeline-e62cf8eb79c8b99eeff41a47b489af1ecde4fe49.tar.bz2
timeline-e62cf8eb79c8b99eeff41a47b489af1ecde4fe49.zip
Merge pull request #245 from crupest/post
Backend: post get and patch.
Diffstat (limited to 'BackEnd/Timeline/Models/Validation')
-rw-r--r--BackEnd/Timeline/Models/Validation/TimelinePostContentTypeValidator.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/BackEnd/Timeline/Models/Validation/TimelinePostContentTypeValidator.cs b/BackEnd/Timeline/Models/Validation/TimelinePostContentTypeValidator.cs
new file mode 100644
index 00000000..483cce06
--- /dev/null
+++ b/BackEnd/Timeline/Models/Validation/TimelinePostContentTypeValidator.cs
@@ -0,0 +1,18 @@
+using System;
+
+namespace Timeline.Models.Validation
+{
+ public class TimelinePostContentTypeValidator : StringSetValidator
+ {
+ public TimelinePostContentTypeValidator() : base(TimelinePostContentTypes.AllTypes) { }
+ }
+
+ [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)]
+ public class TimelinePostContentTypeAttribute : ValidateWithAttribute
+ {
+ public TimelinePostContentTypeAttribute() : base(typeof(TimelinePostContentTypeValidator))
+ {
+
+ }
+ }
+}