I have an EF6 request that takes a list of IDs and executes a request:
public IList<Audit> AuditsByIDs(List<int> ids)
{
return _db.Audits
.Include(p => p.User)
.Where(p => ids.Any(i => i == p.Id)).ToList();
}
It works for a small number of identifiers , but when it comes to hundreds, I get an error:
Some part of your SQL statement is nested too deep. Rewrite the query or break it down into smaller queries.
How can I return a request only after the identifiers have passed ? I can not change the database :(
source
share