Hi/Lo algorithm
This implementation uses hi/lo algorithm to generate identifiers. Algorithm uses a high value retrieved from database and combines it with range of low values to generate a unique identifier. High value is from column of table by default. But you can override this to use a different table. This algorithm also supports specifying a parameter which can be used to retrieve high value for different entities from different rows of the table.
While auto incremented IDs are simpler, whenever you add an entity to the context, this addition forces the entity to be inserted to the database. That is because we can only retrieve the ID if the actual insertion happens in the case of auto incremented IDs. The HiLo algorithm frees us from this restriction by reserving the IDs beforehand using a database sequence.
Learning NHibernate 4
hilo needs a set of two numbers to work with. One is hi which is sourced from a database table and other is lo which is calculated by NHibernate. NHibernate combines these two numbers using a formula to generate a unique number that can be used as identifier.
ASP.NET Core 2 Fundamentals
Onur Gumus and Mugilan T. S. Ragupathi
Suhas Chatekar