修改更新验证
parent
a6b39efdf2
commit
e60ddf1f79
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue