There is Campaign Entity and for that, I have CampaignRepository which have this functions
- public IList FindAll();
- public Campaign FindByCampaignNumber(string number);
But now i want this criterias -:
- Find campaigns that are created today.
- Find campaigns that are created in this month
- Find top 5 latest campaigns.
- Find campaigns that are created in this year.
So for all these campaigns filters,
Do i create separate function for each of them in repository ?
and implement like this way.
Getall campaigns and then filter required campaigns, but i do not want all campaigns. While searching in google i find this solution's
1: http://russelleast.wordpress.com/2008/09/20/implementing-the-repository-and-finder-patterns/
Is there any method i can avoid multiple functions or do i go ahead and create seperate functions for each of this filter ?