main
1using System.Collections.Generic;
2using gorilla.commons.utility;
3using MoMoney.Domain.Accounting;
4using MoMoney.Domain.repositories;
5using MoMoney.DTO;
6using MoMoney.Service.Contracts.Application;
7
8namespace MoMoney.Service.Application
9{
10 public class GetAllBillsQuery : IGetAllBillsQuery
11 {
12 readonly IBillRepository bills;
13 readonly Mapper<IBill, BillInformationDTO> mapper;
14
15 public GetAllBillsQuery(IBillRepository bills, Mapper<IBill, BillInformationDTO> mapper)
16 {
17 this.bills = bills;
18 this.mapper = mapper;
19 }
20
21 public IEnumerable<BillInformationDTO> fetch()
22 {
23 return bills.all().map_all_using(mapper);
24 }
25 }
26}