this piece of code is driving me crazy, it's endlessly looping
public IQueryable<Regionn> getRegions()
{
var reg = from p in cnx.Regionns
select p;
return reg;
}
I have 2 breakpoints, one on the opening bracket and the second one on the closing bracket
And they just go up and down, up and down, up and down ......
While this code executes normally
public IQueryable<Investor> getInvestors()
{
var inv = from p in cnx.Investors
select p;
return inv;
}
What I'm doing is binding the query to a List , when using the toList() function it causes
An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll
which seems is caused by an infinite loop which lead to check the flow of the function doing the endless loop
I copied the code to the main form in which i'm using it, if I Print the resulting count of the query it just prints the number of recrods in the list over and over again