[Solved] Can anyone convert this linq code into a SQL query (because I don’t understand what is it doing)?


Here is what is doing this piece of LinQ :

The code is using the Panels Entity set of you dbContext, that’s mean the Panels table in your database.

Then, you are including an Invoice Entity, because it is part of your Panels one. It is most likely another table with a relation with Panels.

You are also including what looks like a collection of PanelTypeEntries to your Panels Entity. You probably have a N-N relation between those tables in your database. While including PanelTypeEntries, you are just SELECTing its SubItems property. Probably because Panels does not contains a List ofPanelTypeEntries, but a List of SubItems.

The where() clause is the same as in SQL.

Finaly, the ToList() ask to the provider to execute the request and to store it in a List. That’s why var don2‘s type is of List.

0

solved Can anyone convert this linq code into a SQL query (because I don’t understand what is it doing)?