main
1using gorilla.utility;
2using solidware.financials.infrastructure;
3using solidware.financials.messages;
4using solidware.financials.service.domain;
5using solidware.financials.service.orm;
6
7namespace solidware.financials.service.handlers
8{
9 public class FindAllFamilyHandler : Handles<FindAllFamily>
10 {
11 PersonRepository people;
12 Mapper mapper;
13 ServiceBus bus;
14
15 public FindAllFamilyHandler(PersonRepository people, Mapper mapper, ServiceBus bus)
16 {
17 this.people = people;
18 this.bus = bus;
19 this.mapper = mapper;
20 }
21
22 public void handle(FindAllFamily item)
23 {
24 people
25 .find_all()
26 .map_all_using<Person, AddedNewFamilyMember>(mapper)
27 .each(x => bus.publish(x));
28 }
29 }
30}