/// <summary> /// 保存分类数据实体 /// </summary> /// <param name="keyValue">主键</param> /// <param name="entity">实体</param> public void SaveEntity(string keyValue, InterfaceEntity entity) { try { if (string.IsNullOrEmpty(keyValue)) { entity.Create(); this.BaseRepository().Insert(entity); } else { entity.Modify(keyValue); this.BaseRepository().Update(entity); } } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowServiceException(ex); } } }
/// <summary> /// 保存分类数据实体 /// </summary> /// <param name="keyValue">主键</param> /// <param name="entity">实体</param> public void SaveEntity(string keyValue, InterfaceEntity entity) { try { cache.Remove(cacheKey, CacheId.Interface); interfaceService.SaveEntity(keyValue, entity); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowBusinessException(ex); } } }