How to identify problems with n + 1 in Linq to SQL?

What is the best way to detect n + 1 selection issues if I use linq for SQL, we are currently working on a project and it seems to display some lists quite slowly. What is the best method to detect this?

+3
source share
2 answers

n + 1 , , SQL.

DataContext.Log TextWriter, SQL . , . Linq to SQL DebuggerWriter. DebuggerWriter.

DataContext db = new DataContext();
#if DEBUG
db.Log = new DebuggerWriter();
#endif
+2

Source: https://habr.com/ru/post/1723471/


All Articles