1

I can log the underlying query of a linq query by simply using the ToString() method.

string raw = query.Where(..whatever..).ToString();

I need the exact underlying query for the FirstOrDefault() method

query.FirstOrDefault().ToString()

because we get a very bad performance for this query and we want to analyze it. Here the ToString() method only returns the class name.

Is there a possibility to get the underlying query?

StefanG
  • 1,234
  • 2
  • 22
  • 46

0 Answers0