NHibernate cascade and generated guid ids - why are they not generated for the children on save?
- by asgerhallas
I do the following:
var @case = new Case
{
Name = "test"
};
// User is persistent and loaded in the same session
User.AddCase(@case); // sets @case.User = User too
Session.Update(User);
response.CaseId = @case.Id;
The cascade on User.Cases is set to All. But @case.Id is not set until the transaction is committed. Is that expected behavior? I would very much like to get the Id before committing. Can it be done?