/// <summary> /// 添加实体 /// </summary> /// <param name="entity"></param> /// <param name="IsSave"></param> /// <returns></returns> public T AddEntity(T entity, bool isSave) { entity = DBService.AddEntity(entity); if (isSave) { if (SaveChanges() > 0) { return(null); } } return(entity); }