riteshrao/ncommon

Identity key problems

marvealmar opened this issue · 1 comments

I have problems with identiy keys, It will not update until I commit the scope, this is a problem because i need the identity to fill other entities.

I've run into the same issue, you can call flush on the current unit of work to get around this, eg...

// inside unit of work scope

entityRepository.Save(entity);
UnitOfWorkManager.CurrentUnitOfWork.Flush();
// can now use entity.Id