I have a Linq to Entites query that needs to run only when ProgramId equals the parameter passed in by the URL:
var PatientFollowUpResult = surveyResponseRepository.Query.Count(r => r.PatientFollowUp);
For example, how do I count all of r.PatientFollowUp for r.ProgramId = 1?
If I understood correctly, you might have multiple hit based on the passed parameter and you are trying to get the total count for all these matches for a property on each?
In that case where and SelectMany would do the trick