namespace Entity
{
/// <summary>
/// 用户登录消息
/// </summary>
public class UserLoginMessage : IEntity
{
List<string> message = new List<string>();
/// <summary>
/// 列表
/// </summary>
public List<string> List
{
get { return this.message; }
}
public IDataEntity Entity { get; set; }
#region IEntity 成员
public bool IsValid
get { return this.message.Count == 0; }
public IEnumerable<RuleViolation> GetRuleViolations()
throw new Exception("不提供本方法");
#endregion
}
}
/// 模型接口,与数据库无关
public interface IEntity
/// 数据验证(是否成功)
bool IsValid { get; }
/// 获取验证失败的信息枚举,它使用了简单的迭代器,如果GetRuleViolations有错误则返回假
/// <returns></returns>
IEnumerable<RuleViolation> GetRuleViolations();
/// 数据库对象统一协调接口
public interface IDataEntity
{