using System; using System.Collections.Generic; using OpenAuth.Domain.Utility; namespace OpenAuth.Domain.Model { public partial class User :EntityBase { public User() { this.Departments = new List(); this.Roles = new List(); } public string Account { get; set; } public string Password { get; set; } public string RealName { get; set; } public string RoleId { get; set; } public bool Enabled { get; set; } public bool DeleteMark { get; set; } public virtual ICollection Departments { get; set; } public virtual ICollection Roles { get; set; } public Role DefaultRole { get; set; } protected override void Validate() { if(string.IsNullOrEmpty(Account)) AddBrokenRule(new BusinessRule("Account","用户帐号不能为空")); } } }