OpenAuth.Net/OpenAuth.Domain/Model/User.cs

33 lines
953 B
C#
Raw Normal View History

2015-04-15 23:57:36 +08:00
using System;
using System.Collections.Generic;
using OpenAuth.Domain.Utility;
2015-04-15 23:57:36 +08:00
2015-04-25 12:31:01 +08:00
namespace OpenAuth.Domain.Model
2015-04-15 23:57:36 +08:00
{
public partial class User :EntityBase<string>
2015-04-15 23:57:36 +08:00
{
public User()
{
this.Departments = new List<Department>();
this.Roles = new List<Role>();
}
public string Account { get; set; }
public string Password { get; set; }
public string RealName { get; set; }
public string RoleId { get; set; }
2015-04-25 12:31:01 +08:00
public bool Enabled { get; set; }
public bool DeleteMark { get; set; }
2015-04-15 23:57:36 +08:00
public virtual ICollection<Department> Departments { get; set; }
public virtual ICollection<Role> Roles { get; set; }
2015-04-25 12:31:01 +08:00
2015-04-27 00:10:02 +08:00
public Role DefaultRole { get; set; }
protected override void Validate()
{
if(string.IsNullOrEmpty(Account))
AddBrokenRule(new BusinessRule("Account","<22>û<EFBFBD><C3BB>ʺŲ<CABA><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>"));
}
2015-04-15 23:57:36 +08:00
}
}