1
Vote

when i try use where clause geting error An unhandled exception of type 'System.StackOverflowException' occurred in EntityFramework.dll in Dynamic linq

description

var q = db.Test.AsQueryable();
var ids=List<int>(); //size 10000
string predict = string.Join(" or ", ccode.Select(p => String.Format("({0} {1} @{2})", "ID", "=", ids.IndexOf(p))));
q = q.Where(predict, ids.Cast<object>().ToArray());
int count= q.Count(); //getting error
An unhandled exception of type 'System.StackOverflowException' occurred in EntityFramework.dll
if ids size less then 1500 then it's working fine getting count

comments