public void Handle(AddPersonDocumentNoFileCommand command) { var repository = this.contextFactory(); var personDocument = new Domain.PersonDocument(command.PersonDocumentId, command.PersonId, command.DocumentTypeId, command.Number, command.Complement, command.DateIssued, command.DateValidUntil, command.InsertedDateUTC, command.FileId, command.Active, command.UserSystemId); repository.Save(personDocument); }
public void Handle(PersonDocumentAdded @event) { var command = new AddPersonDocumentNoFileCommand(); command.DocumentTypeId = @event.DocumentTypeId; command.Number = @event.Number; command.Active = @event.Active; command.PersonId = @event.PersonId; command.UserSystemId = @event.UserSystemId; this.bus.Send(command); }