Exemple #1
0
        public async Task <IActionResult> GetFamilyMembersAsync()
        {
            var query  = new GetFamilyMembersQuery();
            var result = await _mediator.Send(query);

            return(Ok(result));
        }
        public Task <List <FamilyMember> > Handle(GetFamilyMembersQuery request, CancellationToken cancellationToken)
        {
            var results = _familyMembersRepository.GetFamilyMembers();

            return(Task.FromResult(
                       results.Select(res =>
                                      new FamilyMember(
                                          res.Id,
                                          res.Firstname,
                                          res.Lastname,
                                          res.BirthDate,
                                          res.DeathDate,
                                          res.Congregation)).ToList()));
        }