修改更新验证
This commit is contained in:
@@ -457,14 +457,14 @@ namespace IRaCIS.Core.Infra.EFCore
|
||||
{
|
||||
if (verifyItem.verifyType == VerifyEnum.OnlyUpdate)
|
||||
{
|
||||
if (await _dbSet.IgnoreQueryFilters().AnyAsync(verifyItem.VerifyExp).ConfigureAwait(false))
|
||||
if (await _dbSet.AnyAsync(verifyItem.VerifyExp).ConfigureAwait(false))
|
||||
{
|
||||
throw new BusinessValidationFailedException(verifyItem.VerifyMsg);
|
||||
}
|
||||
}
|
||||
else if (verifyItem.verifyType == VerifyEnum.Both)
|
||||
{
|
||||
if (await _dbSet.IgnoreQueryFilters().AnyAsync(verifyItem.VerifyExp.And(t => t.Id != entitydId)).ConfigureAwait(false))
|
||||
if (await _dbSet.AnyAsync(verifyItem.VerifyExp.And(t => t.Id != entitydId)).ConfigureAwait(false))
|
||||
{
|
||||
throw new BusinessValidationFailedException(verifyItem.VerifyMsg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user