Using cascade in NHibernate
- by Tyler
I have two classes, call them Monkey and Banana, with a one-to-many bidirectional relationship.
Monkey monkey = new Monkey();
Banana banana = new Banana();
monkey.Bananas.Add(banana);
banana.Monkey = monkey;
hibernateService.Save(banana);
When I run that chunk of code, I want both monkey and banana to be persisted. However, it's only persisting…