From d42d826ae863b20913321d229a168b05d723db73 Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 6 Feb 2021 16:41:19 +0800 Subject: ... --- .../Validation/TimelinePostContentTypeValidator.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 BackEnd/Timeline/Models/Validation/TimelinePostContentTypeValidator.cs (limited to 'BackEnd/Timeline/Models/Validation') 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)) + { + + } + } +} -- cgit v1.2.3