public OperationResult AddRes(params ResDto[] dtos) { return(ResRepository.Insert(dtos, dto => { if (ResRepository.CheckExists(m => m.Name == dto.Name)) { throw new Exception("同组织机构中名称为“{0}”的角色已存在,不能重复添加。".FormatWith(dto.Name)); } })); }
public OperationResult DeleteRes(params int[] ids) { return(ResRepository.Delete(ids)); }
public OperationResult EditRes(params ResDto[] dtos) { return(ResRepository.Update(dtos)); }
public bool CheckResExists(Expression <Func <Res, bool> > predicate, int id = 0) { return(ResRepository.CheckExists(predicate, id)); }