nhibernate - how to model one to many relationship in domain driven design -


i'm using domain driven design , use nhibernate orm

i have entity named certificate , entity named condition , intermediate table saving 1 many relationship between these 2 entity.

a condition can has many certificates

as condition , certificates separate agreagate roots, , based on domain driven rules can not hold agregate in , agregateid can placed inside it. putting below code in condition agregate can not true

 private list<certificate> _certificatelist;  . . .  public ireadonlycollection<certificate> certificatelist { { return _certificatelist.asreadonly(); } } 

and below code seems not true too

 private list<certificateid> _certificateidlist;  . . .  public ireadonlycollection<certificateid> certificateidlist { { return _certificateidlist.asreadonly(); } } 

would me model relationship?

thanks

it depends on business rules, if there no rules spanning certificates of same condition reference conditionid within certificate , rely on database query fetch associtations.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -