As per title. Using native ID's
The only thing I can think to do is to call GetByExample(entityJustInserted) and pick the one with the highest ID. Not great...anyone got a better way?
Thanks.
As per title. Using native ID's
The only thing I can think to do is to call GetByExample(entityJustInserted) and pick the one with the highest ID. Not great...anyone got a better way?
Thanks.
You can get it directly off of the entity you just inserted:
For example:
entityRepository.Save(entity);
return entity.Id;
NHibernate will automatically populate the property with the generated id.