/// <summary> /// 验证实体 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool CheckModel <T>(T model) where T : BaseEntity, new() { try { if (!check.Check(model)) { throw new Exception(check.ErrorMessage); } return(true); } catch (Exception ex) { this.SetError(ex.Message); return(false); } }
/// <summary> /// 验证实体 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool CheckModel(BaseModel model) { try { if (!check.Check(model)) { throw new Exception(check.ErrorMessage); } return(true); } catch (Exception ex) { this.SetError(check.ErrorMessage); return(false); } }