From 1a998040268282086549e67ae81f8e059ee885a9 Mon Sep 17 00:00:00 2001 From: 杨宇千 Date: Wed, 21 Aug 2019 23:55:42 +0800 Subject: Add validators. --- Timeline/Models/UserDetail.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Timeline/Models/UserDetail.cs') diff --git a/Timeline/Models/UserDetail.cs b/Timeline/Models/UserDetail.cs index 91439c6a..4af88450 100644 --- a/Timeline/Models/UserDetail.cs +++ b/Timeline/Models/UserDetail.cs @@ -1,12 +1,19 @@ using Timeline.Entities; +using Timeline.Models.Validation; namespace Timeline.Models { public class UserDetail { + [ValidateWith(typeof(UserDetailValidators.QQValidator))] public string QQ { get; set; } + + [ValidateWith(typeof(UserDetailValidators.EMailValidator))] public string EMail { get; set; } + + [ValidateWith(typeof(UserDetailValidators.PhoneNumberValidator))] public string PhoneNumber { get; set; } + public string Description { get; set; } private static string CoerceEmptyToNull(string value) -- cgit v1.2.3