I assume you have a concurrency problem there because
objectiveResult
apparently is a class member and not a local variable. So while one call to this method is about to execute
ToList()
on
objectiveResult
, another call overwrites it as it finishes the the query call to
_db.usp_GetEmployeeListForObjectiveChart(..)
and then both try to execute
ToList()
on the same query result object. Make
objectiveResult
a local variable of that method and it should be good.
edit: Illustration of variable declaration scope:
class SomeClass
{
int SomeMemberVariable;
void SomeMethod()
{
int someLocalVariable;
SomeMemberVariable = 1;
}
}
You declared
objectiveResult
as a class member like
SomeMemberVariable
in this example. You need to declare it locally like
someLocalVariable
instead.