My vote will be for ISchoolclassService
, if you have one. I would't create one just for this purpose however.
It also depends on what SchoolclassCodeComparer
does. If it has it's own data access, then it would be invoking the same repository to fetch school codes?
If there is a way one could pass the constraint imposed by SchoolclassCodeComparer
to the query, then I would have this in the repository. Postprocessing of resultset using various rules could reside in the service.
I prefer to have the repository layer deal with DataAccess. Logic in Dataaccess would be limited to constructing parameters, and creating projections of result returned (if required).
Massaging/filtering the dataset based on any other business logic could be the service's job.