修改一版
This commit is contained in:
@@ -107,6 +107,8 @@ namespace IRaCIS.Core.Infra.EFCore
|
||||
|
||||
Task<bool> AnyAsync(Expression<Func<TEntity, bool>> exp, bool ignoreQueryFilters = false);
|
||||
|
||||
bool Any(Expression<Func<TEntity, bool>> exp, bool ignoreQueryFilters = false);
|
||||
|
||||
Task<TResult> MaxAsync<TResult>(Expression<Func<TEntity, TResult>> selector);
|
||||
|
||||
Task<int> CountAsync(Expression<Func<TEntity, bool>> whereLambda = null, bool ignoreQueryFilters = false);
|
||||
|
||||
@@ -469,6 +469,19 @@ namespace IRaCIS.Core.Infra.EFCore
|
||||
return await query.AsNoTracking().AnyAsync(exp);
|
||||
}
|
||||
|
||||
|
||||
public bool Any(Expression<Func<TEntity, bool>> exp, bool ignoreQueryFilters = false)
|
||||
{
|
||||
var query = _dbSet.AsQueryable();
|
||||
|
||||
if (ignoreQueryFilters)
|
||||
{
|
||||
query = query.IgnoreQueryFilters();
|
||||
}
|
||||
|
||||
return query.AsNoTracking().Any(exp);
|
||||
}
|
||||
|
||||
public async Task<int> CountAsync(Expression<Func<TEntity, bool>> whereLambda = null, bool ignoreQueryFilters = false)
|
||||
{
|
||||
var query = _dbSet.AsQueryable();
|
||||
|
||||
Reference in New Issue
Block a user