Question: Why is this error happening, "InvalidOperationException: An exception was thrown while attempting to evaluate the LINQ query parameter expression 'ToInt32()'. Answer: It is considered a bad practice to have a LINQ query do so much in terms of evaluating parameters, if you want your LINQ query to run faster separate the parameters into their own variables so that the LINQ Query does not have to recompile every time you execute it. The Variables will have to be populated and the LINQ query will only have to compile on runtime and then stores the reference to the memory block allocated for the parameter variable. This way the execution will go without this error, I must point out that this error happens randomly and if you are able to catch it, then it's time to fix it. I hope this helps you, if it does leave a comment below to let other developers know how you solved it.