/// <summary> /// 修改 /// </summary> /// <param name="relation">关系表</param> public void ModifyHSRelation(HSRelation relation) { if (relation == null) throw new ArgumentNullException("HSRelation is null"); IUnitOfWork unitOfWork = _HSRelationRepository.UnitOfWork; _HSRelationRepository.Modify(relation); //complete changes in this unit of work unitOfWork.CommitAndRefreshChanges(); }
/// <summary> /// 移除 /// </summary> /// <param name="relation"></param> public void RemoveHSRelation(HSRelation relation) { if (relation == null) throw new ArgumentNullException("HSRelation is null"); IUnitOfWork unitOfWork = _HSRelationRepository.UnitOfWork; _HSRelationRepository.Remove(relation); try { unitOfWork.Commit(); } catch (Exception ex) { } }
/// <summary> /// 新增 /// </summary> /// <param name="relation"></param> public void AddHSRelation(HSRelation relation) { if (relation == null) throw new ArgumentNullException("HSRelation is null"); IUnitOfWork unitOfWork = _HSRelationRepository.UnitOfWork; _HSRelationRepository.Add(relation); //complete changes in this unit of work try { unitOfWork.Commit(); } catch(Exception ex){} }