So, I am working on a project with a team and we are using Entity Framework. We basically want to use linq to entities, and not use stored procedures. I use quite a bit of lists and IEnumerables and so does everyone else.
My question is, will converting the dataset produced by a stored procedure to an IEnumerable dramatically slow down the applications performance speed, say it parses through 1,000’s of rows. Or would it be better to convert the store procedure to linq to entities(the procedure is a bit complex).
We have not set up testing unit tests and integration yet.
2
Well, it depends. On most of the projects I have worked on, converting to a list has worked out just fine. As such, it is my usual first course of action in this situation. However, there have been times where converting to a list is too slow. My advice would be to try it and see if the performance is acceptable. If it is, great. If not, get out the profiler and make sure the list conversion is the real culprit. If it is, try making the procedure in linq to entities and see how it compares.
TL/DR: Try it. If it’s not fast enough, try something else.