Returning newly created entities from the aggregate

<[email protected]>
Newsgroups gmane.comp.programming.domain-driven-design
Message-ID <[email protected]>
Hi, 
 

 I have requirements to allow users of my system to create an organisation hierarchy. At the moment I'm fetching the parent organisation and calling RegisterSubOrganisation(subOrganisationName) on it.
 

 After the user clicks to create this they should then be redirected to a view of the new organisation. To achieve this the application will require the ID of the newly created organisation.
 

 I'm unsure whether I should be returning an ID from the above register method, or a the new model that was created as part of the operation, or if I'm approaching this in an awkward manner.
 

 From what I've read on the topic, commands shouldn't be returning anything. As registering a sub organisation is a command I guess I shouldn't return anything, but that would mean I would have to perform a query to get the newest child organisation. This seems daft and inaccurate though.
 

 Can anyone guide me at all on this please? Am I missing something obvious, should I just suck it up and return an ID from the command?
 

 

 Regards,
 Matt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.