# mvc orm ###### tags: `火箭` `mvc` # mssql 設定驗證登入資料    # modal      # 建兩個類別 # 套件管理器主控台 Enable-Migrations Add-Migration AddMemberAddress 更動專案的紀錄 Update-Database 更新資料庫 Update-Database -script 腳本化 # 類別 [Key] 主鍵 [Display(Name ="編號")] 名稱 [DatabaseGenerated(DatabaseGeneratedOption.Identity)] 流水號 [MaxLength(length:50)] [Required] [Required(ErrorMessage = "{0}必填")] [Display(Name = "密碼")] [StringLength(100,ErrorMessage ="{0}長度至少必須為{2}個字,最大不能超過{1}個字",MinimumLength = 4)] public DateTime? IntiDate { set; get; } 加問號 允許空值 # EnumList.cs ```csharp= public enum GenderType { 男 = 0, 女 = 1, 其他 = 2 } ``` # 關聯 member ```public virtual ICollection<Address> Addresses { set; get; }``` address [ForeignKey("MemberID")] public virtual Member Member { set; get; } # controller   
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up