remember that your .Where(x => x.isActive == true) filter .Where(x => x.isActive == true) does not apply to the procedure itself. When you are dealing with tables, the filter is passed to the where clause and executed in the database. In your case, proc will be executed (without an active sentence), the full set of results will be returned to the applications, and after that where will be applied.
I know that you said that proc is faster, but are you sure that you are somehow not passing isActive = true as a parameter?
I see that you already have parameters for this proc, so itβs possible if you add the status as another parameter and apply it at the request level, this will improve your performance.
source share