Skip to content

Agregate root with entities #121

Answered by Sairyss
issamwahbi asked this question in Q&A
Discussion options

You must be logged in to vote

Indeed I need to have vehicles inside of Employee. Because it is the same bounded context. The vehicles cannot exist without and employee

Maybe in your case it makes sense to have it like that, but just to clarify things:
the fact that vehicles cannot exist without an employee not necessary means it has to be part of the same aggregate root. Your employees can also have a Manager, a Wallet, a Department they belong to, and a bunch of other relations that cannot exist one without the other. But it doesn't mean that you have to put all of the above into the same aggregate root.

Since I am using the SqlRepositoryBase as a unique repository for all my application. I cannot have the saveEmp…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@issamwahbi
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by issamwahbi
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