public async Task <OperationResponse> UpdateAsync(FunctionInputDto dto) { dto.NotNull(nameof(dto)); return(await _functionRepository.UpdateAsync(dto, async (f, e) => { bool isExist = await this.Entities.Where(o => o.Id != f.Id && o.LinkUrl.ToLower() == f.LinkUrl.ToLower()).AnyAsync(); if (isExist) { throw new AppException("此功能已存在!!!"); } })); }
public async Task <OperationResponse> InsertAsync(FunctionInputDto input) { input.NotNull(nameof(input)); return(await _functionRepository.InsertAsync(input, async f => { bool isExist = await this.Entities.Where(x => x.LinkUrl.ToLower() == input.LinkUrl.ToLower()).AnyAsync(); if (isExist) { throw new SuktAppException("此功能已存在!!!"); } })); }