瀏覽代碼

[Authentication] Add required attributes for login dbo

develop
Robin Thoni 9 年之前
父節點
當前提交
1cc9e9a1d7
共有 2 個文件被更改,包括 8 次插入1 次删除
  1. 1
    0
      Authentication/Authentication.csproj
  2. 7
    1
      Authentication/DBO/BasicUserLogin.cs

+ 1
- 0
Authentication/Authentication.csproj 查看文件

@@ -55,6 +55,7 @@
55 55
       <HintPath>..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
56 56
     </Reference>
57 57
     <Reference Include="System" />
58
+    <Reference Include="System.ComponentModel.DataAnnotations" />
58 59
     <Reference Include="System.Configuration" />
59 60
     <Reference Include="System.Core" />
60 61
     <Reference Include="System.IdentityModel" />

+ 7
- 1
Authentication/DBO/BasicUserLogin.cs 查看文件

@@ -1,9 +1,15 @@
1
-namespace iiie.Authentication.DBO
1
+using System.ComponentModel.DataAnnotations;
2
+
3
+namespace iiie.Authentication.DBO
2 4
 {
3 5
     public class BasicUserLogin
4 6
     {
7
+        [Required]
8
+        [MinLength(1)]
5 9
         public string Username { get; set; }
6 10
 
11
+        [Required]
12
+        [MinLength(1)]
7 13
         public string Password { get; set; }
8 14
     }
9 15
 }

Loading…
取消
儲存