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?