Hi, Im currently working on a code base that avoids Repository.Add() as much as possible. Instead, we use an aggregate root along with cascade all mapping. (eg: to add something, we simply do customer.Orders.Add(...)) We're also using sequential guids generated in the code.
The problem Ive noticed is that when I perform something like customer.Orders.Add(...), Nhibernate doesnt seem to be aware of the new order. Its internal list of entities stored in the session (by unique identifier) isnt yet aware of the new order. Therefore later in code (still during the transaction), Repository.GetById(...) fails, returning null. (We're using a CQRS structure so application event handlers deal with functionality later down the process) Is there any way of adding a new entity to the current session when collection.Add occurs, and avoiding Repository.Add()? regards Andy -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
