Select N+1 - Database Code within a loop
I'd like to query for instances of the Select N+1 problem. Where database code is happening within a loop resulting in 'N' database queries for each iteration of the loop where one or two well-designed queries would do.
This could be implemented by searching for any method calls to a sub-typer of IRepository<T> or Repository<T> that occurs within a for, foreach or Enumerable loop.
4
votes
![](https://secure.gravatar.com/avatar/0063120282b977666f72610b36eed8a6?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)