static IEnumerable<Transaction> Filter(IEnumerable<Transaction> transactions, Period period) { var beginOfMonth = new DateTime(period.Year, period.Month, 01); var endOfMonth = new DateTime(period.Year, period.Month, 01).AddMonths(1); return from t in transactions where (beginOfMonth <= t.Date && t.Date < endOfMonth) select t; }
static void Run(IEnumerable<Transaction> transactions, Period period) { var filteredTransactions = Filter(transactions, period); var categorizer = new Categorizer(); var categorized = categorizer.Categorize(filteredTransactions); Reporter.Report(categorized, period); }