修改一版
This commit is contained in:
@@ -970,18 +970,25 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// 删除系统问题标准
|
||||
///// </summary>
|
||||
///// <param name="readingQuestionCriterionSystemId"></param>
|
||||
///// <returns></returns>
|
||||
//[HttpDelete("{readingQuestionCriterionSystemId:guid}")]
|
||||
//public async Task<IResponseOutput> DeleteReadingQuestionCriterionSystem(Guid readingQuestionCriterionSystemId)
|
||||
//{
|
||||
// await _readingQuestionCriterionSystemRepository.DeleteFromQueryAsync(t => t.Id == readingQuestionCriterionSystemId);
|
||||
// var success = await _readingQuestionCriterionSystemRepository.SaveChangesAsync();
|
||||
// return ResponseOutput.Result(success);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 删除系统问题标准
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{id:guid}")]
|
||||
public async Task<IResponseOutput> DeleteReadingQuestionCriterionSystem(Guid id)
|
||||
{
|
||||
|
||||
|
||||
if (await _readingQuestionCriterionTrialRepository.AnyAsync(x => x.IsConfirm && x.ReadingQuestionCriterionSystemId == id))
|
||||
{
|
||||
throw new BusinessValidationFailedException("当前标准被引用过了,不可以删除");
|
||||
}
|
||||
|
||||
await _readingQuestionCriterionSystemRepository.DeleteFromQueryAsync(t => t.Id == id);
|
||||
var success = await _readingQuestionCriterionSystemRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Result(success);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user