Exemplo n.º 1
0
        public Task Handle(RegisterBirthCommand command)
        {
            var personalRecord = PersonalRecord.ActOfBorn(command.PersonId, command.MotherId, command.FatherId,
                                                          command.Date, command.BornLatitude, command.BornLongitude);

            return(_repository.SaveAggregate(personalRecord));
        }
        public async Task <Guid> RegisterBirth(RegisterBirthRequest request)
        {
            var command = new RegisterBirthCommand
            {
                PersonId      = Guid.NewGuid(),
                MotherId      = request.MotherId,
                FatherId      = request.FatherId,
                Date          = request.Date,
                BornLatitude  = request.BornLatitude,
                BornLongitude = request.BornLongitude
            };

            await _commandHandler.Handle(command);

            return(command.PersonId);
        }