main
 1using System;
 2using System.Collections.Generic;
 3using gorilla.commons.utility;
 4using MoMoney.Domain.Accounting;
 5using MoMoney.Domain.Core;
 6
 7namespace MoMoney.Domain.accounting
 8{
 9    public interface IGeneralLedger
10    {
11        IEnumerable<ILedgerEntry> get_all_the_entries_for(IMonth month);
12    }
13
14    [Serializable]
15    public class GeneralLedger : IGeneralLedger
16    {
17        readonly List<ILedgerEntry> entries;
18
19        public GeneralLedger(List<ILedgerEntry> entries)
20        {
21            this.entries = entries;
22        }
23
24        public IEnumerable<ILedgerEntry> get_all_the_entries_for(IMonth month)
25        {
26            return entries.where(x => month.represents(x.entry_date()));
27        }
28    }
29}