Skip to content

CommandHandler - How to instantiate new aggregate with parameterized constructor #901

Answered by rasmus
dbrassard-genetec asked this question in Q&A
Discussion options

You must be logged in to vote

Since you really don't know if the aggregate is already created at the time or it will be created by some competing thread I don't think doing it in the command handler is a good idea. Any information you would want to pass to the aggregate could as easily be passed via any methods and if you want some special factory for your aggregates, create a custom implementation for IAggregateFactory

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dbrassard-genetec
Comment options

Answer selected by dbrassard-genetec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants