main
1using Gorilla.Commons.Infrastructure.Logging;
2using gorilla.commons.utility;
3using presentation.windows.common;
4using presentation.windows.common.messages;
5using presentation.windows.server.domain;
6using presentation.windows.server.orm;
7
8namespace presentation.windows.server.handlers
9{
10 public class FindAllFamilyHandler : AbstractHandler<FindAllFamily>
11 {
12 PersonRepository people;
13 Mapper mapper;
14 ServiceBus bus;
15
16 public FindAllFamilyHandler(PersonRepository people, Mapper mapper, ServiceBus bus)
17 {
18 this.people = people;
19 this.bus = bus;
20 this.mapper = mapper;
21 }
22
23 public override void handle(FindAllFamily item)
24 {
25 this.log().debug("receieved find all family request.");
26 people
27 .find_all()
28 .map_all_using<Person, AddedNewFamilyMember>(mapper)
29 .each(x => bus.publish(x));
30 }
31 }
32}