I am using LINQ for my DB EF model. I have a particularly complex logic to generate a report and I initially tried to create a view and access it using LINQ. The performance was quite low due to multiple joins and multiple sub queries in the view so now I am thinking of moving the logic to an SP which I believe will increase the performance.
I need to know if there are any known issues with using SP with LINQ in EF. And am I doing something wrong or anti-pattern. Please let me know if there are any alternatives too.
Regards,
Bhavik
No you can always use stored procedure if that fits your requirement. LINQ queries performance may suffer as the queries get complex and stored procedure may help you. In the mean time you may revise your linq query and write an efficient one. I don’t think it is anti-pattern as you can find many resources no MSDN about using stored procedure with LINQ. As a reference I am quoting Scott Gu post here