diff options
| author | 杨宇千 <crupest@outlook.com> | 2019-08-21 18:33:07 +0800 |
|---|---|---|
| committer | 杨宇千 <crupest@outlook.com> | 2019-08-21 18:33:07 +0800 |
| commit | 62a3557ab62e1fa188e7498643d7cf0221a18322 (patch) | |
| tree | 72f5a8f65048f1495dddff7f12cedbd5eb4e39fc /Timeline/Models | |
| parent | fd95f9abc017575b13a31dd16ac72ef663e984d6 (diff) | |
| download | timeline-62a3557ab62e1fa188e7498643d7cf0221a18322.tar.gz timeline-62a3557ab62e1fa188e7498643d7cf0221a18322.tar.bz2 timeline-62a3557ab62e1fa188e7498643d7cf0221a18322.zip | |
Add database entity and service.
Diffstat (limited to 'Timeline/Models')
| -rw-r--r-- | Timeline/Models/UserDetail.cs | 31 | ||||
| -rw-r--r-- | Timeline/Models/Validation/UserDetailValidator.cs | 11 |
2 files changed, 42 insertions, 0 deletions
diff --git a/Timeline/Models/UserDetail.cs b/Timeline/Models/UserDetail.cs new file mode 100644 index 00000000..91439c6a --- /dev/null +++ b/Timeline/Models/UserDetail.cs @@ -0,0 +1,31 @@ +using Timeline.Entities;
+
+namespace Timeline.Models
+{
+ public class UserDetail
+ {
+ public string QQ { get; set; }
+ public string EMail { get; set; }
+ public string PhoneNumber { get; set; }
+ public string Description { get; set; }
+
+ private static string CoerceEmptyToNull(string value)
+ {
+ if (string.IsNullOrEmpty(value))
+ return null;
+ else
+ return value;
+ }
+
+ public static UserDetail From(UserDetailEntity entity)
+ {
+ return new UserDetail
+ {
+ QQ = CoerceEmptyToNull(entity.QQ),
+ EMail = CoerceEmptyToNull(entity.EMail),
+ PhoneNumber = CoerceEmptyToNull(entity.PhoneNumber),
+ Description = CoerceEmptyToNull(entity.Description)
+ };
+ }
+ }
+}
diff --git a/Timeline/Models/Validation/UserDetailValidator.cs b/Timeline/Models/Validation/UserDetailValidator.cs new file mode 100644 index 00000000..5fdaec00 --- /dev/null +++ b/Timeline/Models/Validation/UserDetailValidator.cs @@ -0,0 +1,11 @@ +using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace Timeline.Models.Validation
+{
+ public class UserDetailValidator
+ {
+ }
+}
|
