/// <summary> /// 创建一个学校单位 /// </summary> /// <param name="validationErrors">返回的错误信息</param> /// <param name="db">数据库上下文</param> /// <param name="entity">一个学校单位</param> /// <returns></returns> public bool Create(ref ValidationErrors validationErrors, School entity) { try { repository.Create(entity); return(true); } catch (Exception ex) { validationErrors.Add(ex.Message); ExceptionsHander.WriteExceptions(ex); } return(false); }