Recently, I was working on two websites which are heavily relying on LINQ and Entity Framework(EF). I was surprised by its complexity when LINQ queries data from EF. I never thought LINQ queries can be such mess up. The problem is that it uses tons of codes to join the tables in order to retrieve related data on the front-end layer and then populates the formatted data into a report. It is as complicated as spaghetti. The program is running very long time because it is a complicated single process. As a result, the slowness is the penalty. Also, the concurrency issues would be raised on this long process. I believe that a simple solution is the best solution. something can be done in a better way for example Stored Procedure in SQL.
The data manipulation on this report can be done with Stored Procedures . Why a simple job can be done easily by using ADO.net with Stored Procedures but it is using tons LINQ queries with EF to do the same job instead?
LINQ is good on the LINQ to Objects, LINQ to Generic Collections. But, it should not be avoided on the DB table manipulation on the front-end layer. We should let Stored Procedure handle all these table joints and leave few SQL work on front-end layer.