aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Models/Validation
diff options
context:
space:
mode:
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))
+ {
+
+ }
+ }
+}